ExecutorServiceMode { public static ExecutorServiceMode timeConstraint(long timeout) { return new GenericExecutorServiceMode(Optional.fromNullable(timeout), Optional.<Integer>absent()); }  static ExecutorServiceMode standard(); static ExecutorServiceMode timeConstraint(long timeout); static ExecutorServiceMode batchSizeContraint(int batchSize); static ExecutorServiceMode timeoutAndBatchSizeContraint(long timeout, int batchSize);  }
@Test public void timeConstraint() { ExecutorServiceMode timeConstraint = ExecutorServiceMode.timeConstraint(4242L); timeConstraint.configureJppfExecutorService(executorService); verify(executorService, only()).setBatchTimeout(eq(4242L)); }