### Question:
JsonObjectImpl extends AbstractMap<String, JsonValue> implements JsonObject, Serializable { @Override public String getString(final String name) { return valueOrExcpetion(name, JsonString.class).getString(); } JsonObjectImpl(final Map<String, JsonValue> backingMap, final BufferStrategy.BufferProvider<char[]> provider); @Override JsonArray getJsonArray(final String name); @Override JsonObject getJsonObject(final String name); @Override JsonNumber getJsonNumber(final String name); @Override JsonString getJsonString(final String name); @Override String getString(final String name); @Override String getString(final String name, final String defaultValue); @Override int getInt(final String name); @Override int getInt(final String name, final int defaultValue); @Override boolean getBoolean(final String name); @Override boolean getBoolean(final String name, final boolean defaultValue); @Override boolean isNull(final String name); @Override ValueType getValueType(); @Override String toString(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override Set<java.util.Map.Entry<String, JsonValue>> entrySet(); @Override void clear(); @Override JsonValue remove(final Object key);  }### Answer:
@Test(expected = NullPointerException.class) public void testGetStringMissingKeyShouldThrowNullPointerException() { getObject().getString("missing"); }
@Test public void testGetStringWithDefaultShouldReturnDefault() { String expected = "default"; assertEquals(expected, getObject().getString("missing", expected)); }