public static byte[] jsonNodeToBinary(JsonNode node, String about) {
        try {
            byte[] value = node.binaryValue();
            if (value == null) {
                throw new IllegalArgumentException(about + ": expected Base64-encoded binary data.");
            }

            return value;
        } catch (IOException e) {
            throw new UncheckedIOException(about + ": unable to retrieve Base64-encoded binary data", e);
        }
    }
@Test
    public void testBinaryNode() throws IOException {
        byte[] expected = new byte[] {5, 2, 9, 4, 1, 8, 7, 0, 3, 6};
        StringWriter writer = new StringWriter();
        ObjectMapper mapper = new ObjectMapper();

        mapper.writeTree(mapper.createGenerator(writer), new BinaryNode(expected));

        JsonNode textNode = mapper.readTree(writer.toString());

        assertTrue(textNode.isTextual(), String.format("Expected a JSON string but was: %s", textNode));
        byte[] actual = MessageUtil.jsonNodeToBinary(textNode, "Test base64 JSON string");
        assertArrayEquals(expected, actual);
    }