code: public void setResult(T result) {
          lock.lock();
          try {
              if(Objects.equals(expected_result, result))
                  super.setResult(result);
          }
          finally {
              lock.unlock();
          }
      }
docs: Sets the result only if expected_result matches result