@Test public void serial() { executor.execute(new AddToRuns(1)); assertEquals(Collections.<Integer>emptyList(), runs); singleExecutor.drain(); assertEquals(Arrays.asList(1), runs); executor.execute(new AddToRuns(2)); assertEquals(Arrays.asList(1), runs); singleExecutor.drain(); assertEquals(Arrays.asList(1, 2), runs); }
@Override public void execute(Runnable r) { runQueue.add(checkNotNull(r, "'r' must not be null.")); schedule(r); }
SerializingExecutor implements Executor, Runnable { @Override public void execute(Runnable r) { runQueue.add(checkNotNull(r, "'r' must not be null.")); schedule(r); } }
SerializingExecutor implements Executor, Runnable { @Override public void execute(Runnable r) { runQueue.add(checkNotNull(r, "'r' must not be null.")); schedule(r); } SerializingExecutor(Executor executor); }
SerializingExecutor implements Executor, Runnable { @Override public void execute(Runnable r) { runQueue.add(checkNotNull(r, "'r' must not be null.")); schedule(r); } SerializingExecutor(Executor executor); @Override void execute(Runnable r); @Override void run(); }
SerializingExecutor implements Executor, Runnable { @Override public void execute(Runnable r) { runQueue.add(checkNotNull(r, "'r' must not be null.")); schedule(r); } SerializingExecutor(Executor executor); @Override void execute(Runnable r); @Override void run();  }