/** * Test whether this pattern matches a given operator. * * @param operator the operator to match or {@code null}, which represents the absence of an operator to match * @return whether the operator matches */ @SuppressWarnings("unchecked") public OperatorMatch match(Operator operator) { if (operator == null) return null; // Only match by the class so far. if (this.matchOperatorClass(operator) && this.matchSlots(operator) && this.matchAdditionalTests((T) operator)) { this.checkSanity(operator); return new OperatorMatch(this, operator); } return null; }