### Question:
SimpleConfiguration implements Configuration, Serializable { public String get (String name, String def) { Object obj = props.get (name); if (obj instanceof String[]) { String[] arr= (String[]) obj; obj = arr.length > 0 ? arr[0] : null; } else if (obj instanceof List) { List l = (List) obj; obj = l.size() > 0 ? l.get(0) : null; } return (obj instanceof String) ? Environment.get((String) obj, def) : def; } SimpleConfiguration();  SimpleConfiguration(Properties props);  SimpleConfiguration(String filename); String get(String name, String def); String[] getAll(String name); int[] getInts(String name); long[] getLongs(String name); double[] getDoubles(String name); boolean[] getBooleans(String name); String get(String name); int getInt(String name); int getInt(String name, int def); long getLong(String name); long getLong(String name, long def); double getDouble(String name); double getDouble(String name, double def); boolean getBoolean(String name); boolean getBoolean(String name, boolean def); void load(String filename); synchronized void put(String name, Object value); @Override Set<String> keySet(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testGet() throws Throwable { String result = new SimpleConfiguration(new Properties()).get("testSimpleConfigurationName", null); assertNull(result, "result"); }
@Test public void testGet1() throws Throwable { String result = new SimpleConfiguration(new Properties()).get("testSimpleConfigurationName", "testSimpleConfigurationDef"); assertEquals("testSimpleConfigurationDef", result, "result"); }
@Test public void testGet3() throws Throwable { String result = new SimpleConfiguration(new Properties()).get("testSimpleConfigurationName"); assertEquals("", result, "result"); }
@Test public void testGetThrowsNullPointerException() throws Throwable { try { new SimpleConfiguration((Properties) null).get("testSimpleConfigurationName", "testSimpleConfigurationDef"); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"java.util.Properties.get(Object)\" because \"this.props\" is null", ex.getMessage(), "ex.getMessage()"); } } }
@Test public void testGetThrowsNullPointerException1() throws Throwable { try { new SimpleConfiguration((Properties) null).get("testSimpleConfigurationName"); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"java.util.Properties.get(Object)\" because \"this.props\" is null", ex.getMessage(), "ex.getMessage()"); } } }