code: public void clearResults(long sequence) {
      if (sequence > commandLowWaterMark) {
        for (long i = commandLowWaterMark + 1; i <= sequence; i++) {
          results.remove(i);
          commandLowWaterMark = i;
        }
      }
    }
docs: Clears command results up to the given sequence number.
  <p>
  Command output is removed from memory up to the given sequence number. Additionally, since we know the
  client received a response for all commands up to the given sequence number, command futures are removed
  from memory as well.
  
  @param sequence The sequence to clear.