### Question:
SingleCellExtractor implements ByteArrayExtractor { @Override public Collection<byte[]> extract(Result result) { byte[] bytes = result.getValue(columnFamily, columnQualifier); if (bytes == null) { return Collections.emptyList(); } else { return Lists.newArrayList(bytes); } } SingleCellExtractor(byte[] columnFamily, byte[] columnQualifier); @Override Collection<byte[]> extract(Result result); @Override byte[] getColumnFamily(); @Override byte[] getColumnQualifier(); @Override boolean isApplicable(KeyValue keyValue); @Override boolean containsTarget(Result result);  }### Answer:
@Test public void testExtract() { Result result = mock(Result.class); byte[] value = new byte[] { 1, 2, 3 }; when(result.getValue(COLUMN_FAMILY, COLUMN_QUALIFIER)).thenReturn(value); assertEquals(ImmutableList.of(value), extractor.extract(result)); }
@Test public void testExtract_CellNotPresent() { Result result = mock(Result.class); when(result.getValue(COLUMN_FAMILY, COLUMN_QUALIFIER)).thenReturn(null); assertEquals(Collections.emptyList(), extractor.extract(result)); }