### Question:
ThriftStructuredDataSupport extends AbstractThriftStructuredDataSupport<K> { @Override public <T> T readFromPath(K rowKey, Path path, TypeReference<T> type) { validateArgs(rowKey, path); int count = Integer.MAX_VALUE; boolean reversed = false; String start = path.toString(); String finish = getFinishString(start); Map<String,Object> columnsMap = operations.readColumnsAsMap(rowKey, start, finish, count, reversed); if (columnsMap.isEmpty()) { return null; } Map<Path,Object> pathMap = getTerminalPathMap(path, columnsMap); Object structure = Composer.get().compose(pathMap); return readMapper.convertValue(structure, new JacksonTypeReference<T>(type)); } ThriftStructuredDataSupport(ColumnFamilyOperations<K,String,Object> operations); @Override BatchContext beginBatch(); @Override void applyBatch(BatchContext batchContext); @Override T readFromPath(K rowKey, Path path, TypeReference<T> type); @Override void writeToPath(K rowKey,
                            Path path,
                            Object value,
                            @Nullable BatchContext batchContext); @Override void deletePath(K rowKey, Path path, @Nullable BatchContext batchContext);  }### Answer:
@Test(groups = {"unit"}) public void shouldReadFromPath() throws Exception { Map<String,Object> stringObjectMap = getExpectedMap(false); when(operations.readColumnsAsMap(rowKey, "a/b/c/", getFinishString("a/b/c/"), Integer.MAX_VALUE, false)).thenReturn(stringObjectMap); TestPojo result = dao.readFromPath(rowKey, path, typeReference); TestPojo expectedResult = new TestPojo("v1", 42L, true, Arrays.asList("e1", "e2")); assertEquals(result, expectedResult); }
@Test(groups = {"unit"}) public void shouldReadFromPathNotFound() throws Exception { when(operations.readColumnsAsMap(rowKey, "a/b/c/", getFinishString("a/b/c/"), Integer.MAX_VALUE, false)).thenReturn(Collections.<String,Object>emptyMap()); TestPojo result = dao.readFromPath(rowKey, path, typeReference); assertNull(result); }