### Question:
ObjectNodeTypeAdapter implements CustomTypeAdapter<Object> { @Override public Object decode(CustomTypeValue value) { if (!(value instanceof GraphQLJsonObject)) { throw new IllegalArgumentException("Expected 'GraphQLJsonObject', got: " + value); } return mapper.convertValue(value.value, JsonNode.class); }  @Override CustomTypeValue<?> encode(Object value); @Override Object decode(CustomTypeValue value);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void decodeNotObject() { underTest.decode(new CustomTypeValue.GraphQLNumber(1)); }
@Test public void decode() { var result = (JsonNode) underTest.decode(new GraphQLJsonObject(Map.of())); assertThat(result, is(mapper.createObjectNode())); }