StringKeyValueScheme extends StringScheme implements KeyValueScheme { @Override public List<Object> deserializeKeyAndValue(byte[] key, byte[] value) { if ( key == null ) { return deserialize(value); } String keyString = StringScheme.deserializeString(key); String valueString = StringScheme.deserializeString(value); return new Values(ImmutableMap.of(keyString, valueString)); }  @Override List<Object> deserializeKeyAndValue(byte[] key, byte[] value);  }
@Test public void testDeserializeWithNullKeyAndValue() throws Exception { assertEquals(Arrays.asList("test"), scheme.deserializeKeyAndValue(null, "test".getBytes())); }
@Test public void testDeserializeWithKeyAndValue() throws Exception { assertEquals(Arrays.asList(ImmutableMap.of("key", "test")), scheme.deserializeKeyAndValue("key".getBytes(), "test".getBytes())); }