Code example for Future

Methods: cancelget

0
    this.unit = unit;
  } 
 
  public Void call() throws ExecutionException, InterruptedException {
    try { 
      future.get(timeout, unit);
    } catch (TimeoutException te) {
      future.cancel(true);
    } 
    return null; 
  } 
 
} 
Connect your IDE to all the code out there  Get Codota for Java