### Question:
DataSetAdapter extends ForwardingMap<String, String> { @Override public String get(final Object key) { String[] pair = getKeysPair(key); if (pair.length == 1) { return null; } String dsKey = pair[0]; DataSet currentDataSet = dataSourceProvider.get().getCurrentDataSet(dsKey); if (currentDataSet == null) { log.warn("No data set available: '" + dsKey + "'. Forgot to call 'generate?'"); return null; } String value = pair[1]; String[] split = value.split(JFunkConstants.INDEXED_KEY_SEPARATOR); return split.length > 1 ? currentDataSet.getValue(split[0], Integer.parseInt(split[1])) : currentDataSet.getValue(split[0]); } @Inject  DataSetAdapter(final Provider<DataSource> dataSourceProvider); @Override String get(final Object key);  }### Answer:
@Test public void testExistingValues() { dataSource.getNextDataSet("test"); String testValue1 = adapter.get("test testKey1"); Assert.assertEquals(testValue1, "testValue1"); String testValue2 = adapter.get("test testKey2"); Assert.assertEquals(testValue2, "testValue2"); }
@Test public void testNulls() { dataSource.getNextDataSet("test"); String testValue1 = adapter.get("keyWithoutValue"); Assert.assertNull(testValue1); String testValue2 = adapter.get("nonExistingDsKey foo"); Assert.assertNull(testValue2); }