@Contract("null -> null")
  @Nullable
  static TerminalOperation getTerminal(List<? extends OperationRecord> operations) {
    if (operations == null || operations.isEmpty()) return null;
    OperationRecord record = operations.get(operations.size()-1);
    if(record.myOperation instanceof TerminalOperation) {
      return (TerminalOperation)record.myOperation;
    }
    return null;
  }
@Contract("null -> null")
  @Nullable
  static TerminalOperation getTerminal(List<? extends OperationRecord> operations)