### Question:
RawKey implements Key<T> { @Override public byte[] toBytes() { return key; } RawKey(byte[] key); @Override byte[] toBytes(); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Key otherKey);  }### Answer:
@Test public void testToBytesReturnsByteValueOfKey() { final byte[] rawKey = new byte[] { 1, 2, 3 }; final Key<Entity> key = new RawKey<>(rawKey); assertArrayEquals(rawKey, key.toBytes()); }
@Test public void testKeyIsCopiedOnConstruction() { final byte[] rawKey = new byte[] { 1, 2, 3 }; final Key<Entity> key = new RawKey<>(rawKey); rawKey[2] = 4; assertNotEquals(rawKey, key.toBytes()); }