### Question:
SubjectSchemas implements Iterable<T> { public static <T extends SchemaInfo> Builder<T> builder() { return builder(null); } SubjectSchemas(
            @JsonProperty("schemas") Collection<T> schemas); @Override Iterator<T> iterator(); int size(); Collection<T> getSchemas(); @JsonIgnore Map<Integer, T> getSchemasAsMap(); @JsonIgnore String getSubject(); T getSchema(int version); @JsonIgnore T getEarliestSchema(); @JsonIgnore Integer getEarliestSchemaVersion(); @JsonIgnore T getLatestSchema(); @JsonIgnore Integer getLatestSchemaVersion(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); Builder<T> toBuilder(); static Builder<T> builder(); static Builder<T> builder(SubjectSchemas<T> origin); static SubjectSchemas<T> with(Collection<T> schemas); SubjectSchemas<R> transform(Function<T, R> function);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testIdentitySerializedToJsonAndBack() throws Exception { SubjectSchemas<IdentitySchemaInfo> origin = SubjectSchemas.<IdentitySchemaInfo>builder(). appendSchema(SchemaTestData.randomIdentitySchemaInfo("subject1")). appendSchema(SchemaTestData.randomIdentitySchemaInfo("subject1")). appendSchema(SchemaTestData.randomIdentitySchemaInfo("subject1")). build(); String json = JsonMapper.toJson(origin); Assert.assertNotNull(json); SubjectSchemas<IdentitySchemaInfo> deserialized = JsonMapper.jsonToObject(json, SubjectSchemas.class); Assert.assertNotNull(deserialized); Assert.assertEquals(origin, deserialized); }
@SuppressWarnings("unchecked") @Test public void testBasicSerializedToJsonAndBack() throws Exception { SubjectSchemas<BasicSchemaInfo> origin = SubjectSchemas.<BasicSchemaInfo>builder(). appendSchema(SchemaTestData.randomBasicSchemaInfo("subject1")). appendSchema(SchemaTestData.randomBasicSchemaInfo("subject1")). appendSchema(SchemaTestData.randomBasicSchemaInfo("subject1")). build(); String json = JsonMapper.toJson(origin); Assert.assertNotNull(json); SubjectSchemas<BasicSchemaInfo> deserialized = JsonMapper.jsonToObject(json, SubjectSchemas.class); Assert.assertNotNull(deserialized); Assert.assertEquals(origin, deserialized); }
@SuppressWarnings("unchecked") @Test public void testLiteSerializedToJsonAndBack() throws Exception { SubjectSchemas<LiteSchemaInfo> origin = SubjectSchemas.<LiteSchemaInfo>builder(). appendSchema(SchemaTestData.randomLiteSchemaInfo("subject1")). appendSchema(SchemaTestData.randomLiteSchemaInfo("subject1")). appendSchema(SchemaTestData.randomLiteSchemaInfo("subject1")). build(); String json = JsonMapper.toJson(origin); Assert.assertNotNull(json); SubjectSchemas<LiteSchemaInfo> deserialized = JsonMapper.jsonToObject(json, SubjectSchemas.class); Assert.assertNotNull(deserialized); Assert.assertEquals(origin, deserialized); }
@SuppressWarnings("unchecked") @Test public void testFullSerializedToJsonAndBack() throws Exception { SubjectSchemas<FullSchemaInfo> origin = SubjectSchemas.<FullSchemaInfo>builder(). appendSchema(SchemaTestData.randomFullSchemaInfo("subject1")). appendSchema(SchemaTestData.randomFullSchemaInfo("subject1")). appendSchema(SchemaTestData.randomFullSchemaInfo("subject1")). build(); String json = JsonMapper.toJson(origin); Assert.assertNotNull(json); SubjectSchemas<FullSchemaInfo> deserialized = JsonMapper.jsonToObject(json, SubjectSchemas.class); Assert.assertNotNull(deserialized); Assert.assertEquals(origin, deserialized); }