### Question:
Reader { final Object parse(final Class<?> type) throws ParseException { skipIgnorables(); if (position >= length) { return null; } final char c = text.charAt(position); if (c == '[') { position++; final List<Object> values = new ArrayList<>(); boolean hasNext = (nextTokenStart() != ']'); while (hasNext) { values.add(parse(type)); hasNext = skipListSeparator(']'); } position++; return values; } if (c != '{') { Object token = nextToken(c == '"'); if (token != null) { if (Number.class.isAssignableFrom(type) || type == Boolean.class) { token = Numbers.valueOf(token.toString(), type); } } return token; } final int objectStart = position++; final Map<String,Class<?>> definition = factory.getDefinition(type); final Map<String,Object> properties = new HashMap<>(); boolean hasNext = (nextTokenStart() != '}'); while (hasNext) { final int entryStart = position; final CharSequence token = nextToken(nextTokenStart() == '"'); if (nextTokenStart() != ':') { throw new ParseException("Expected \"key: value\" pair.", position); } position++; final String key = String.valueOf(token); Class<?> childType = definition.get(key); if (childType == null) { childType = String.class; } if (properties.put(key, parse(childType)) != null) { throw new ParseException("Duplicated key: \"" + key + "\".", entryStart); } hasNext = skipListSeparator('}'); } position++; return factory.create(type, definition, properties, objectStart); } Reader(final CharSequence text);   }### Answer:
@Test public void testParse() throws ParseException { final Reader reader = new Reader(WriterTest.JSON); final Metadata md = (Metadata) reader.parse(Metadata.class); assertTrue(WriterTest.createMetadata().equals(md, ComparisonMode.DEBUG)); }