### Question:
RawJsonTranscoder implements Transcoder { @Override @SuppressWarnings("unchecked") public <T> T decode(final Class<T> target, final byte[] input, int flags) { if (target.isAssignableFrom(byte[].class)) { return (T) input; } else if (target.isAssignableFrom(String.class)) { return (T) new String(input, StandardCharsets.UTF_8); } else { throw new DecodingFailureException("RawJsonTranscoder can only decode into either byte[] or String!"); } } private  RawJsonTranscoder(); @Override EncodedValue encode(final Object input); @Override @SuppressWarnings("unchecked") T decode(final Class<T> target, final byte[] input, int flags); static RawJsonTranscoder INSTANCE; }### Answer:
@Test void decodesJsonPassthroughString() { String input = "{\"hello\": true}"; String output = RAW_JSON_TRANSCODER.decode( String.class, input.getBytes(StandardCharsets.UTF_8), CodecFlags.JSON_COMPAT_FLAGS ); assertEquals(input, output); }
@Test void decodesJsonPassthroughByteArray() { byte[] input = "{\"hello\": true}".getBytes(StandardCharsets.UTF_8); byte[] output = RAW_JSON_TRANSCODER.decode( byte[].class, input, CodecFlags.JSON_COMPAT_FLAGS ); assertArrayEquals(input, output); }