### Question:
DataSet extends BaseModel { public List<SchemaField> getFields() { return getFields(false); } DataSet();  DataSet(JSONObject jsonObject); String getBasePath(); String getViewId(); String getConnectionId(); String getDescription(); Dule getDule(); String getSchema(); JSONObject getObservableSchema(); List<SchemaField> getFields(); List<SchemaField> getFields(FieldsFrom fieldsFrom); List<SchemaField> getFields(boolean useFlatNamesForLeafNodes); List<SchemaField> getFields(boolean useFlatNamesForLeafNodes, FieldsFrom fieldsFrom); SchemaRef getSchemaRef(); List<SchemaField> getFlattenedSchemaFields(); List<SchemaField> getFlattenedSchemaFields(FieldsFrom fieldsFrom); void matchFlattenedSchemaFields(Map<String, String> sdkFields); void matchFlattenedSchemaFields(Map<String, String> sdkFields, FieldsFrom fieldsFrom); Boolean getIsDuleEnabled(); FileDescription getFileDescription(); @Override DataSet build(JSONObject obj); void setSchema(String schema); void setSchemaRef(JSONObject jsonObject); List<SchemaField> getSchemaFieldsFromSchemaRef();  }### Answer:
@Test public void testGetFields() { assertTrue(ds.getFields(false).size() == 4); }
@Test public void testGetFieldsFromObservableSchema() { assertTrue(ds_Sample2.getFields(false, FieldsFrom.OBSERVABLE_SCHEMA).size() == 6); }
@Test public void testGetSchemaFieldsFromCatalog() throws ParseException, ConnectorSDKException { System.setProperty("com.adobe.platform.xdm.blacklist.filter", "model/Profile.person"); JSONParser jsonParser = new JSONParser(); JSONObject jsonObject = (JSONObject)(jsonParser.parse(datasetInnerSample2)); when(catService.getSchemaFields( anyString(), anyString(), eq("/xdms/model/Profile"), eq(false) )).thenReturn(ds_Sample2.getFields(DataSet.FieldsFrom.OBSERVABLE_SCHEMA)); DataSet dataSet = new DataSetExtension(jsonObject); final List<SchemaField> fieldList = dataSet.getFields(false, DataSet.FieldsFrom.SCHEMA); assertEquals(fieldList.size(), 5); }
@Test public void testGetSchemaFieldsFromSchemaRegistry() throws ParseException, ConnectorSDKException { JSONParser jsonParser = new JSONParser(); JSONObject jsonObject = (JSONObject)(jsonParser.parse(datasetInnerSample3)); when(schemaRegistryService.getSchemaFields( anyString(), anyString(), anyObject(), eq(false) )).thenReturn(ds_Sample2.getFields(DataSet.FieldsFrom.OBSERVABLE_SCHEMA)); DataSet dataSet = new DataSetExtension(jsonObject); final List<SchemaField> fieldList = dataSet.getFields(false, DataSet.FieldsFrom.SCHEMA); assertEquals(fieldList.size(), 6); }