### Question:
BinaryType implements Type, Serializable { @Override public Object fromJson(JsonNode node) { if (node == null || node instanceof NullNode) { return null; } else if (node.isValueNode()) { try { return node.binaryValue(); } catch (Exception e) { } } throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, node.toString()); } private  BinaryType(); @Override String getName(); @Override boolean supportsEq(); @Override boolean supportsOrdering(); @Override int compare(Object v1, Object v2); @Override Object cast(Object obj); @Override JsonNode toJson(JsonNodeFactory factory, Object obj); @Override Object fromJson(JsonNode node); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static final Type TYPE; static final String NAME; }### Answer:
@Test public void testFromJson() { JsonNode jsonNode = JsonNodeFactory.withExactBigDecimals(false).binaryNode(new byte[0]); Object fromJson = binaryType.fromJson(jsonNode); assertTrue(fromJson instanceof byte[]); }
@Test(expected = Error.class) public void testFromJsonWithIncompatibleValue() { JsonNode jsonNode = JsonNodeFactory.withExactBigDecimals(false).objectNode(); binaryType.fromJson(jsonNode); }