### Question:
ObjectJS extends AnyJS { @SuppressWarnings("unchecked") public static ObjectJS create(Object o, StringifierFactory stringifierFactory) { if (o == null) { return null; } else { ObjectJS objectJS = new ObjectJS(); for (Getter getter : GetterFactory.getGetters(o.getClass())) { String propertyName = getter.getName(); Stringifier propertyStringifier = stringifierFactory.getStringifier(getter.getType(), getter.getSubType()); if (propertyStringifier != null) { Object propertyValue = getter.get(o); objectJS.setSimpleAttribute(propertyName, propertyValue, propertyStringifier); } } return objectJS; } } 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 testCreate() { Foo foo = new Foo(123L, "Hello"); ObjectJS fooJS = ObjectJS.create(foo, stringifierFactory); assertNotNull(fooJS.getAttribute("bar")); assertEquals(((SimpleJS) fooJS.getAttribute("bar")).getValue(), 123L); assertNotNull(fooJS.getAttribute("baz")); assertEquals(((SimpleJS) fooJS.getAttribute("baz")).getValue(), "Hello"); }