### Question:
JavascriptObject { protected Object getProperty(String key) { return checkUndefined(jsObject.getMember(key)); } protected  JavascriptObject(); protected  JavascriptObject(String type); protected  JavascriptObject( String type, String stringRepresentation ); protected  JavascriptObject(String type, Object... args); protected  JavascriptObject(String type, Object[] ary, boolean isArray); protected  JavascriptObject(String type, JSObject jsObject); JSObject getJSObject(); String getVariableName();  }### Answer:
@Test public void testGetProperty() { when(mockJsObject.getMember("myprop")).thenReturn("myvalue"); assertEquals( testJavascriptObject.getProperty("myprop"), "myvalue"); }
@Test public void testGetPropertyGeneric() { LatLong latLong = new LatLong(1, 1); when(mockJsObject.getMember("LatLong")).thenReturn(latLong); LatLong actualLatLong = testJavascriptObject.getProperty("LatLong", LatLong.class); assertEquals( latLong, actualLatLong); }
@Test public void testGetPropertyGeneric_Null() { assertNull(testJavascriptObject.getProperty("foo", String.class)); }