public boolean equals(Object other) { if (other instanceof TypeToNameMap) { TypeToNameMap otherMap = (TypeToNameMap) other; return myPatterns.equals(otherMap.myPatterns) && myNames.equals(otherMap.myNames); } return false; }