code: @Override
      public V get(long timeout, TimeUnit unit) throws ExecutionException, InterruptedException, TimeoutException {
          final long deadlineTimeMillis = System.currentTimeMillis() + unit.toMillis(timeout);
          long millisToWait;
          for (; ; ) {
              Object currentState = this.state;
  
              if (isCancelledState(currentState)) {
                  throw new CancellationException();
              }
              if (isDoneState(currentState)) {
                  return getResult(currentState);
              }
              if (Thread.interrupted()) {
                  throw new InterruptedException();
              }
  
              millisToWait = deadlineTimeMillis - System.currentTimeMillis();
              if (millisToWait <= 0) {
                  throw new TimeoutException();
              }
  
              synchronized (this) {
                  if (!isDoneState(this.state)) {
                      wait(millisToWait);
                  }
              }
          }
      }
docs: PLEASE NOTE: It's legal to override this method, but please bear in mind that you should call super.get() or
  implement the done() and cancelled() callbacks to be notified if this future gets done or cancelled.
  Otherwise the overridden implementation of get() may get stuck on waiting forever.