boolean (RegExpPattern pattern1, RegExpPattern pattern2) { return pattern1 == null ? pattern2 == null : pattern2 != null && areElementArraysEquivalent(pattern1.getBranches(), pattern2.getBranches(), true); }