### Question:
Writer { public void format(final Object object) throws ClassCastException, IOException { if (guard.put(object, Boolean.TRUE) == null) { final MetadataStandard previous = standard; standard = getStandard(object); formatEntries(standard.asValueMap(object, null, KeyNamePolicy.UML_IDENTIFIER, ValueExistencePolicy.NON_EMPTY).entrySet().iterator()); standard = previous; if (guard.remove(object) != Boolean.TRUE) { throw new ConcurrentModificationException(); } } else { out.append(null); } } Writer(final Appendable out); void format(final Object object);  }### Answer:
@Test public void testFormat() throws IOException { final StringBuilder buffer = new StringBuilder(); Writer writer = new Writer(buffer); writer.format(createMetadata()); assertMultilinesEquals("JSON format", JSON, buffer.toString()); }