### Question:
ListOp extends AbstractGeoGigOp<Optional<List<String>>> { public ListOp setDataStore(DataStore dataStore) { this.dataStore = dataStore; return this; }  ListOp setDataStore(DataStore dataStore); static Optional<List<String>> run(DataStore ds);  }### Answer:
@Test public void testEmptyDataStore() throws Exception { ListOp list = new ListOp(); list.setDataStore( TestHelper.createEmptyTestFactory().createDataStore(Collections.emptyMap())); Optional<List<String>> features = list.call(); assertFalse(features.isPresent()); }
@Test public void testTypeNameException() throws Exception { ListOp list = new ListOp(); list.setDataStore(TestHelper.createFactoryWithGetNamesException() .createDataStore(Collections.emptyMap())); assertThrows(GeoToolsOpException.class, list::call); }
@Test public void testList() throws Exception { ListOp list = new ListOp(); list.setDataStore(TestHelper.createTestFactory().createDataStore(Collections.emptyMap())); Optional<List<String>> features = list.call(); assertTrue(features.isPresent()); assertTrue(features.get().contains("table1")); assertTrue(features.get().contains("table2")); }