public boolean equals(Object o) {
         if (this == o) {
            return true;
         }
         if (o == null || getClass() != o.getClass()) {
            return false;
         }

         PatternWrapper that = (PatternWrapper) o;

         if (pattern != null) {
            if (!pattern.equals(that.pattern)) {//give the JVM a shot for forward compatibility
               return pattern.pattern() != null && this.pattern.pattern().equals(this.pattern.pattern());
            }
         } else {
            if (that.pattern != null) {
               return false;
            }
         }

         return true;
      }