Exemplo n.º 1
0
  @Test
  public void cancel_shouldThrowAnUnsupportedOperationException_givenAFutureReturnedByExecute()
      throws Exception {
    Future<?> result = asyncExecutor.execute(() -> {});

    try {
      result.cancel(true);
      fail("Expected an exception");
    } catch (UnsupportedOperationException ignore) {
    }
  }