### Question:
HeapImpl implements Heap { public static String name(final JsonValue declaration) { JsonValue node = declaration.get("name"); if (node.isNull()) { String location = declaration.getPointer().toString(); String type = declaration.get("type").required().asString(); return format("{%s}%s", type, location); } return node.asString(); } HeapImpl();   HeapImpl(final HeapImpl parent);  HeapImpl(final Name name);  HeapImpl(final HeapImpl parent, final Name name); synchronized void init(JsonValue config, String... reservedFieldNames); void addDefaultDeclaration(final JsonValue object); @Override List<T> getAll(final Class<T> type); @Override T get(final String name, final Class<T> type); @Override T resolve(final JsonValue reference, final Class<T> type); @Override T resolve(final JsonValue reference, final Class<T> type, final boolean optional); static String name(final JsonValue declaration); synchronized void put(final String name, final Object object); synchronized void destroy(); Handler getHandler();  }### Answer:
@Test public void testInlineObjectNamingWithNoNameProvided() throws Exception { JsonValue declaration = json(object(field("type", "WelcomeHandler"))); assertThat(HeapImpl.name(declaration)).isEqualTo("{WelcomeHandler}/"); }
@Test public void testInlineObjectNamingWithNameProvided() throws Exception { JsonValue declaration = json(object(field("name", "Inline"), field("type", "WelcomeHandler"))); assertThat(HeapImpl.name(declaration)).isEqualTo("Inline"); }