### Question:
StringKey implements Key<T> { @Override public byte[] toBytes() { return Bytes.toBytes(keyString); } @SuppressWarnings("WeakerAccess") // Used by generated Entities  StringKey(final String keyString); @Override byte[] toBytes(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Override int compareTo(Key otherKey);  }### Answer:
@Test public void testToBytesReturnsByteValueOfKey() { final String keyString = "my key"; final Key<Entity> key = new StringKey<>(keyString); assertArrayEquals(keyString.getBytes(Charset.forName("UTF-8")), key.toBytes()); }