boolean (RegExpNumber number1, RegExpNumber number2) { if (number1 == null) { return number2 == null; } else if (number2 == null) { return false; } final Number value1 = number1.getValue(); final Number value2 = number2.getValue(); return value1 != null && value1.equals(value2); }