@Test public void testIsDone() throws InterruptedException, ExecutionException, TimeoutException { ZigBeeTransactionFuture future = new ZigBeeTransactionFuture(Mockito.mock(ZigBeeTransaction.class)); assertFalse(future.isDone()); CommandResult result = new CommandResult(ZigBeeStatus.FAILURE, null); future.set(result); assertTrue(future.isDone()); assertEquals(result, future.get()); assertEquals(result, future.get(0, TimeUnit.MICROSECONDS)); }
@Override public synchronized boolean isDone() { return cancelled | result != null; }
ZigBeeTransactionFuture implements Future<CommandResult> { @Override public synchronized boolean isDone() { return cancelled | result != null; } }
ZigBeeTransactionFuture implements Future<CommandResult> { @Override public synchronized boolean isDone() { return cancelled | result != null; } ZigBeeTransactionFuture(ZigBeeTransaction transaction); }
ZigBeeTransactionFuture implements Future<CommandResult> { @Override public synchronized boolean isDone() { return cancelled | result != null; } ZigBeeTransactionFuture(ZigBeeTransaction transaction); synchronized void set(final CommandResult result); @Override synchronized boolean cancel(boolean mayInterruptIfRunning); @Override boolean isCancelled(); @Override synchronized boolean isDone(); @Override CommandResult get(); @Override CommandResult get(long timeout, TimeUnit unit); @Override String toString(); }
ZigBeeTransactionFuture implements Future<CommandResult> { @Override public synchronized boolean isDone() { return cancelled | result != null; } ZigBeeTransactionFuture(ZigBeeTransaction transaction); synchronized void set(final CommandResult result); @Override synchronized boolean cancel(boolean mayInterruptIfRunning); @Override boolean isCancelled(); @Override synchronized boolean isDone(); @Override CommandResult get(); @Override CommandResult get(long timeout, TimeUnit unit); @Override String toString();  }