@Test public void isCancelledReturnsTrueIffCancelled() { assertThat(cut.isCancelled(), is(false)); cut.setCancelled(); assertThat(cut.isCancelled(), is(true)); }
@Test public void setIsDoneReturnsFalseIfCancelled() { cut.setCancelled(); assertThat(cut.isDone(), is(false)); }
@Test(expected = CancellationException.class) public void setCancelledLeadsToCancelledException() throws CancellationException, InterruptedException, ExecutionException { cut.setCancelled(); cut.get(); }