@Test
public void testTrySetError() {

  TaskCompletionSource<Void> tcs = new TaskCompletionSource<>();
  Task<Void> task = tcs.getTask();
  assertFalse(task.isCompleted());
  Exception exception = new RuntimeException("DISQUALIFIED");
  boolean success = tcs.trySetError(exception);
  assertTrue(success);
  assertTrue(task.isCompleted());
  assertEquals(exception, task.getError());
}