### Question:
NashornResourceReference extends ResourceReference { public ScheduledExecutorService getScheduledExecutorService() { return scheduledExecutorService; } NashornResourceReference(String name, int coreSize, long delay, TimeUnit delayUnit);  NashornResourceReference(String name, int coreSize, long delay, TimeUnit delayUnit,
		long wait, TimeUnit waitUnit, long maxScriptMemorySize); @Override IResource getResource(); ScheduledExecutorService getScheduledExecutorService();  }### Answer:
@Test public void testRemoteInvocation() throws InterruptedException { WicketTester wicketTester = new WicketTester(new DummyApplication()); MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest(null, null, null) { @Override public ServletInputStream getInputStream() throws IOException { return new MockInputStream(NashornResourceReferenceTest.class .getResourceAsStream("NashornResourceReferenceTest.js")); } }; wicketTester.setRequest(mockHttpServletRequest); NashornResourceReference nashornResourceReference = new NashornResourceReference("nashorn", 50, 50, TimeUnit.SECONDS) { private static final long serialVersionUID = 1L; @Override protected void setup(Attributes attributes, Bindings bindings) { bindings.put("serverValue", 1); } @Override protected Writer getWriter() { return new BufferedWriter(new OutputStreamWriter(System.out)); } @Override protected Writer getErrorWriter() { return new BufferedWriter(new OutputStreamWriter(System.out)); } @Override protected boolean isDebug() { return true; } }; try { wicketTester.startResourceReference(nashornResourceReference); } catch (Exception e) { nashornResourceReference.getScheduledExecutorService().shutdownNow(); nashornResourceReference.getScheduledExecutorService().awaitTermination(10000, TimeUnit.SECONDS); } assertEquals("4", wicketTester.getLastResponseAsString()); }