@Override
    public Bytes cacheKey(final Bytes key) {
        return cacheKey(key, segmentId(key));
    }
@Test
    public void cacheKey() {
        final long segmentId = TIMESTAMP / SEGMENT_INTERVAL;

        final Bytes actualCacheKey = cacheFunction.cacheKey(THE_KEY);
        final ByteBuffer buffer = ByteBuffer.wrap(actualCacheKey.get());

        assertThat(buffer.getLong(), equalTo(segmentId));

        final byte[] actualKey = new byte[buffer.remaining()];
        buffer.get(actualKey);
        assertThat(Bytes.wrap(actualKey), equalTo(THE_KEY));
    }