### Question:
ObjectJS extends AnyJS { @Override public void write(Writer writer) throws IOException { writer.write("{"); boolean first = true; for (Attribute attribute : attributes) { if (first) { first = false; } else { writer.write(","); } writeString(writer, attribute.name); writer.write(":"); attribute.value.write(writer); } writer.write("}"); } ObjectJS(); void setAttribute(String name, AnyJS value); void setSimpleAttribute(String name, T value, Stringifier<T> stringifier); AnyJS getAttribute(String name); @Override void write(Writer writer); @SuppressWarnings("unchecked") static ObjectJS create(Object o, StringifierFactory stringifierFactory);  }### Answer:
@Test public void testWrite() { Foo foo = new Foo(123L, "Hello"); ObjectJS fooJS = ObjectJS.create(foo, stringifierFactory); assertEquals(fooJS.getAttribute("baz").toString(), "\"Hello\""); assertEquals(Integer.parseInt(fooJS.getAttribute("bar").toString()), 123); }