### Question:
DataTypeSearchEngine { public List<DataType> search(final String keyword) { final List<DataType> results = new ArrayList<>(); for (final DataType dataType : findByName(keyword)) { results.addAll(getStack(dataType)); } return results; } @Inject  DataTypeSearchEngine(final DataTypeStore dataTypeStore); List<DataType> search(final String keyword);  }### Answer:
@Test public void testSearch() { final DataType tCity = makeDataType("001", "tCity", TOP_LEVEL_PARENT_UUID); final DataType tCityId = makeDataType("002", "id", "001"); final DataType tCityName = makeDataType("003", "name", "001"); final DataType tPerson = makeDataType("004", "tPerson", TOP_LEVEL_PARENT_UUID); final DataType tPersonId = makeDataType("005", "id", "004"); final DataType tPersonName = makeDataType("006", "name", "004"); final DataType tPersonCity = makeDataType("007", "city", "004"); final DataType tPersonCityId = makeDataType("008", "id", "007"); final DataType tPersonCityName = makeDataType("009", "name", "007"); index(tCity, tCityId, tCityName, tPerson, tPersonId, tPersonName, tPersonCity, tPersonCityId, tPersonCityName); final List<DataType> results = searchEngine.search("name"); assertTrue(results.contains(tCity)); assertFalse(results.contains(tCityId)); assertTrue(results.contains(tCityName)); assertTrue(results.contains(tPerson)); assertFalse(results.contains(tPersonId)); assertTrue(results.contains(tPersonName)); assertTrue(results.contains(tPersonCity)); assertFalse(results.contains(tPersonCityId)); assertTrue(results.contains(tPersonCityName)); }
@Test public void testSearchWhenKeywordIsEmpty() { final List<DataType> results = searchEngine.search(""); verifyNoMoreInteractions(dataTypeStore); assertTrue(results.isEmpty()); }