@Override
    public synchronized void put(final Bytes key, final byte[] value) {
        physicalStore.put(
            prefixKeyFormatter.addPrefix(key),
            value);
    }
@Test
    public void shouldPut() {
        final KeyValue<String, String> sharedKeyV1 = new KeyValue<>("shared", "v1");
        final KeyValue<String, String> sharedKeyV2 = new KeyValue<>("shared", "v2");
        final KeyValue<String, String> sharedKeyV3 = new KeyValue<>("shared", "v3");
        final KeyValue<String, String> segment0KeyOnly = new KeyValue<>("segment0_only", "foo");
        final KeyValue<String, String> segment1KeyOnly = new KeyValue<>("segment1_only", "bar");
        final KeyValue<String, String> negativeSegmentKeyOnly = new KeyValue<>("negative_segment_only", "baz");

        segment0.put(new Bytes(serializeBytes(sharedKeyV1.key)), serializeBytes(sharedKeyV1.value));
        segment0.put(new Bytes(serializeBytes(segment0KeyOnly.key)), serializeBytes(segment0KeyOnly.value));
        segment1.put(new Bytes(serializeBytes(sharedKeyV2.key)), serializeBytes(sharedKeyV2.value));
        segment1.put(new Bytes(serializeBytes(segment1KeyOnly.key)), serializeBytes(segment1KeyOnly.value));
        negativeIdSegment.put(new Bytes(serializeBytes(sharedKeyV3.key)), serializeBytes(sharedKeyV3.value));
        negativeIdSegment.put(new Bytes(serializeBytes(negativeSegmentKeyOnly.key)), serializeBytes(negativeSegmentKeyOnly.value));

        assertEquals("v1", getAndDeserialize(segment0, "shared"));
        assertEquals("v2", getAndDeserialize(segment1, "shared"));
        assertEquals("v3", getAndDeserialize(negativeIdSegment, "shared"));

        assertEquals("foo", getAndDeserialize(segment0, "segment0_only"));
        assertNull(getAndDeserialize(segment1, "segment0_only"));
        assertNull(getAndDeserialize(negativeIdSegment, "segment0_only"));

        assertNull(getAndDeserialize(segment0, "segment1_only"));
        assertEquals("bar", getAndDeserialize(segment1, "segment1_only"));
        assertNull(getAndDeserialize(negativeIdSegment, "segment1_only"));

        assertNull(getAndDeserialize(segment0, "negative_segment_only"));
        assertNull(getAndDeserialize(segment1, "negative_segment_only"));
        assertEquals("baz", getAndDeserialize(negativeIdSegment, "negative_segment_only"));
    }