code: @Override
      public Output apply(Input input) {
          if (input == null) return fn_.apply(input);
          return match_(input)
                  .orElseGet(() -> derive_(input))
                  .getOutput();
      }
docs: Functional implementation.
  
  The actual calculation will only be performed if the input doesn't match
  the input from the most recent invocation.
  
  Null inputs are never remembered.
  @param input Argument to the calculation.
  @return The output of the calculation.