### Question:
BasePayloadExtractor implements PayloadExtractor { @Override public byte[] extractPayload(byte[] tableName, KeyValue keyValue) { if (Bytes.equals(this.tableName, tableName) && CellUtil.matchingColumn(keyValue, columnFamily, columnQualifier)) { return CellUtil.cloneValue(keyValue); } else { return null; } } BasePayloadExtractor(byte[] tableName, byte[] columnFamily, byte[] columnQualifier); @Override byte[] extractPayload(byte[] tableName, KeyValue keyValue);  }### Answer:
@Test public void testExtractPayload_PayloadIncluded() { byte[] payload = extractor.extractPayload(TABLE_NAME, new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, PAYLOAD_DATA)); assertArrayEquals(PAYLOAD_DATA, payload); }
@Test public void testExtractPayload_WrongTable() { byte[] payload = extractor.extractPayload(Bytes.toBytes("wrong_table"), new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, PAYLOAD_DATA)); assertNull(payload); }
@Test public void testExtractPayload_WrongColumnFamily() { byte[] payload = extractor.extractPayload(TABLE_NAME, new KeyValue(ROW, Bytes.toBytes("wrong family"), COLUMN_QUALIFIER, PAYLOAD_DATA)); assertNull(payload); }
@Test public void testExtractPayload_WrongColumnQualifier() { byte[] payload = extractor.extractPayload(TABLE_NAME, new KeyValue(ROW, COLUMN_FAMILY, Bytes.toBytes("wrong qualifier"), PAYLOAD_DATA)); assertNull(payload); }