### Question:
ConnectSchema implements Schema { @Override public List<Field> fields() { if (type != Type.STRUCT) throw new DataException("Cannot list fields on non-struct type"); return fields; } ConnectSchema(Type type, boolean optional, Object defaultValue, String name, Integer version, String doc, Map<String, String> parameters, List<Field> fields, Schema keySchema, Schema valueSchema);  ConnectSchema(Type type, boolean optional, Object defaultValue, String name, Integer version, String doc);  ConnectSchema(Type type); @Override Type type(); @Override boolean isOptional(); @Override Object defaultValue(); @Override String name(); @Override Integer version(); @Override String doc(); @Override Map<String, String> parameters(); @Override List<Field> fields(); Field field(String fieldName); @Override Schema keySchema(); @Override Schema valueSchema(); static void validateValue(Schema schema, Object value); static void validateValue(String name, Schema schema, Object value); void validateValue(Object value); @Override ConnectSchema schema(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static Type schemaType(Class<?> klass);  }### Answer:
@Test(expected = DataException.class) public void testFieldsOnlyValidForStructs() { Schema.INT8_SCHEMA.fields(); }
@Test public void testEmptyStruct() { final ConnectSchema emptyStruct = new ConnectSchema(Schema.Type.STRUCT, false, null, null, null, null); assertEquals(0, emptyStruct.fields().size()); new Struct(emptyStruct); }