### Question:
RedisBytesCodec implements RedisCodec<Bytes, Bytes> { @Override public ByteBuffer encodeKey(@Nullable Bytes key) { if (key == null) { return ByteBuffer.allocate(0); } return ByteBuffer.wrap(key.toArrayUnsafe()); }  @Override ByteBuffer encodeKey(@Nullable Bytes key); @Override Bytes decodeKey(@Nullable ByteBuffer bytes); @Override ByteBuffer encodeValue(@Nullable Bytes value); @Override Bytes decodeValue(@Nullable ByteBuffer bytes);  }### Answer:
@Test void nullKeyEncode() { RedisBytesCodec codec = new RedisBytesCodec(); assertEquals(ByteBuffer.allocate(0), codec.encodeKey(null)); }