@Override public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return wrapped.get(timeout, unit); } }
@Test public void test() throws InterruptedException, ExecutionException, TimeoutException { CancelableRunnable cancelableRunnable = Mockito.mock(CancelableRunnable.class); RunnableScheduledFuture futureTask = Mockito.mock(RunnableScheduledFuture.class); CancelableScheduledFuture<Object> future = new CancelableScheduledFuture<Object>(cancelableRunnable, futureTask); future.cancel(false); Mockito.verify(futureTask, Mockito.times(1)).cancel(false); future.run(); Mockito.verify(futureTask, Mockito.times(1)).run(); future.cancel(true); Mockito.verify(cancelableRunnable, Mockito.times(1)).cancel(); Mockito.verify(futureTask, Mockito.times(1)).cancel(true); future.isDone(); Mockito.verify(futureTask, Mockito.times(1)).isDone(); future.isPeriodic(); Mockito.verify(futureTask, Mockito.times(1)).isPeriodic(); future.get(); Mockito.verify(futureTask, Mockito.times(1)).get(); future.get(100L, TimeUnit.MICROSECONDS); Mockito.verify(futureTask, Mockito.times(1)).get(100L, TimeUnit.MICROSECONDS); future.getDelay(TimeUnit.HOURS); Mockito.verify(futureTask, Mockito.times(1)).getDelay(TimeUnit.HOURS); CancelableScheduledFuture<Object> future2 = new CancelableScheduledFuture<Object>(cancelableRunnable, futureTask); assertTrue(future.equals(future)); assertTrue(future.equals(future2)); assertEquals(future.hashCode(), future.hashCode()); assertEquals(future.hashCode(), future2.hashCode()); }
@Override public V get() throws InterruptedException, ExecutionException { return wrapped.get(); }
@Override public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return futureTask.get(timeout, unit); }
@Override public T get() throws InterruptedException, ExecutionException { return delegate.get(); }
@Override public T get(long l, TimeUnit tu) throws InterruptedException, ExecutionException, TimeoutException { return delegate.get(l, tu); }
@Override public V get() throws InterruptedException, ExecutionException { return futureTask.get(); }
@Override public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return wrapped.get(timeout, unit); } }
@Override public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return originalFuture.get(timeout, unit); }
@Override public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return wrapped.get(timeout, unit); } }
@Override public V get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return this.task.get(timeout, unit); }
@Override public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return realTask.get(timeout, unit); }
@Override public V get() throws InterruptedException, ExecutionException { return originalFuture.get(); }
@Override public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return realTask.get(timeout, unit); }
@Override public V get() throws InterruptedException, ExecutionException { return wrapped.get(); }
@Override public V get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return this.task.get(timeout, unit); }
@Override public T get(long l, TimeUnit tu) throws InterruptedException, ExecutionException, TimeoutException { return delegate.get(l, tu); }
@Override public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return wrapped.get(timeout, unit); } }
@Override public T get() throws InterruptedException, ExecutionException { return delegate.get(); }
@Override public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return task.get(timeout, unit); }