### Question:
BsonDecoder { public static String decodeCString(ByteBuf buffer) { int length = buffer.bytesBefore(BsonConstants.STRING_TERMINATION); if (length < 0) throw new IllegalArgumentException("string termination not found"); String result = buffer.toString(buffer.readerIndex(), length, StandardCharsets.UTF_8); buffer.skipBytes(length + 1); return result; } private  BsonDecoder(); static Document decodeBson(ByteBuf buffer); static Object decodeValue(byte type, ByteBuf buffer); static String decodeCString(ByteBuf buffer);  }### Answer:
@Test void testDecodeStringUnicode() throws Exception { String string = "\u0442\u0435\u0441\u0442"; byte[] bytes = string.getBytes(StandardCharsets.UTF_8); ByteBuf buffer = Unpooled.buffer(); try { buffer.writeBytes(bytes); buffer.writeByte(0); assertThat(BsonDecoder.decodeCString(buffer)).isEqualTo(string); } finally { buffer.release(); } }