### Question:
ImmediateExecutor implements Executor { public void execute(Runnable command) { command.run(); } private  ImmediateExecutor(); void execute(Runnable command); static final ImmediateExecutor INSTANCE; }### Answer:
@Test public void shouldExecuteImmediately() { ImmediateExecutor e = ImmediateExecutor.INSTANCE; long startTime = System.nanoTime(); e.execute(new Runnable() { public void run() { long startTime = System.nanoTime(); for (;;) { try { Thread.sleep(1000); } catch (InterruptedException e) { } if (System.nanoTime() - startTime >= 1000000000L) { break; } } } }); assertTrue(System.nanoTime() - startTime >= 1000000000L); }