Schema implements Serializable { public static Builder builder() { return new Builder(); } Schema(List<Field> fields);  Schema(List<Field> fields, Options options); static Builder builder(); static Schema of(Field... fields); Schema withOptions(Options options); Schema withOptions(Options.Builder optionsBuilder); void setUUID(UUID uuid); Map<String, Integer> getEncodingPositions(); void setEncodingPositions(Map<String, Integer> encodingPositions); @Nullable UUID getUUID(); @Override boolean equals(@Nullable Object o); boolean typesEqual(Schema other); boolean equivalent(Schema other); boolean assignableTo(Schema other); boolean assignableToIgnoreNullable(Schema other); @Override String toString(); @Override int hashCode(); List<Field> getFields(); static Collector<Field, List<Field>, Schema> toSchema(); List<String> getFieldNames(); Field getField(int index); Field getField(String name); int indexOf(String fieldName); boolean hasField(String fieldName); String nameOf(int fieldIndex); int getFieldCount(); Options getOptions();  }
@Test public void testLogicalType() { Schema schema1 = Schema.builder().addLogicalTypeField("logical", new TestType("id", "arg")).build(); Schema schema2 = Schema.builder().addLogicalTypeField("logical", new TestType("id", "arg")).build(); assertEquals(schema1, schema2); Schema schema3 = Schema.builder() .addNullableField("logical", Schema.FieldType.logicalType(new TestType("id", "arg"))) .build(); assertNotEquals(schema1, schema3); Schema schema4 = Schema.builder().addLogicalTypeField("logical", new TestType("id2", "arg")).build(); assertNotEquals(schema1, schema4); Schema schema5 = Schema.builder().addLogicalTypeField("logical", new TestType("id", "arg2")).build(); assertNotEquals(schema1, schema5); }