### Question:
JsThunkFx implements JsThunk { @Override public <T> void setMember(Object scope, String member, T val) { JSObject jsObj = ((DomjnateJSObjectAccess)scope).__DomjnateGetJSObjectFromProxy(); jsObj.setMember(member, DomjnateFx.unwrapObject(val, this)); }  @Override Object getConstructor(String className); @Override T construct(Object constructor, Type type, Object...args); @Override T callMethod(Object obj, String methodName, Type type,
         Object... args); @Override T getMember(Object scope, String member, Type type); @Override void setMember(Object scope, String member, T val); @Override T getIndex(Object obj, int idx, Type type); @Override void setIndex(Object obj, int idx, T val); @Override T cast(Object obj, Type type); @Override T lambdaAsFunction(Object lambda);  }### Answer:
@Test public void testCallback() { Fx.runBlankWebPageInFx((WebEngine engine) -> { JSObject jsWin = (JSObject)engine.executeScript("window"); jsWin.setMember("fn", this); Assert.assertEquals(5, jsWin.eval("fn.callbackFn();")); jsWin.setMember("fnobj", new FnClass()); Assert.assertEquals(7, jsWin.eval("fnobj.fn();")); }); }
@Test(expected=JSException.class) public void testCallbackWithInnerClass() { Fx.runBlankWebPageInFx((WebEngine engine) -> { JSObject jsWin = (JSObject)engine.executeScript("window"); jsWin.setMember("fnobj", new Supplier<Integer>() { @Override public Integer get() { return 9; }}); Assert.assertEquals(9, jsWin.eval("fnobj.get();")); }); }