### Question:
DMNGridSubIndex implements DMNSubIndex { String getValue(final GridCell<?> cell) { final GridCellValue<?> cellValue = cell.getValue(); if (cellValue != null) { final Object value = cellValue.getValue(); if (value instanceof HasNameAndDataTypeCell) { final HasNameAndDataTypeCell hasName = (HasNameAndDataTypeCell) value; return hasName.hasData() ? hasName.getName().getValue() : ""; } else if (value instanceof String || value instanceof Integer) { return String.valueOf(value); } } return ""; } @Inject  DMNGridSubIndex(final DMNGridHelper dmnGridHelper); @Override List<DMNSearchableElement> getSearchableElements(); @Override void onSearchClosed(); @Override void onNoResultsFound();  }### Answer:
@Test public void testGetValue() { final String expected = cellStringValue1; final String actual = index.getValue(cell1); assertEquals(expected, actual); }
@Test public void testGetValueWithCellThatHasNameAndDataType() { final String expected = cellStringValue8; final String actual = index.getValue(cell8); assertEquals(expected, actual); }