public static boolean nearlyEquals(AspectValue[] avs1, AspectValue[] avs2) { int len = avs1.length; if (len != avs2.length) return false; outer: for (int i = 0; i < len; i++) { AspectValue av1 = avs1[i]; int type1 = av1.getAspectType(); inner: for (int j = 0; j < len; j++) { int k = (i + j) % len; AspectValue av2 = avs2[k]; int type2 = av2.getAspectType(); if (type1 == type2) { if (av1.nearlyEquals(av2)) continue outer; break inner; }
public boolean nearlyEquals(Object o) { if (o instanceof AspectValue) { AspectValue that = (AspectValue) o; if (this.getAspectType() == that.getAspectType()) { return MoreMath.nearlyEquals(this.getValue(), that.getValue());
  public static boolean nearlyEquals(AspectValue[] avs1, AspectValue[] avs2) {    int len = avs1.length;    if (len != avs2.length) return false; // Can't be equal if different length  outer:    for (int i = 0; i < len; i++) {      AspectValue av1 = avs1[i];      int type1 = av1.getAspectType();    inner:      for (int j = 0; j < len; j++) {        int k = (i + j) % len;        AspectValue av2 = avs2[k];        int type2 = av2.getAspectType();        if (type1 == type2) {          if (av1.nearlyEquals(av2)) continue outer;          break inner;        }      }      return false;             // Found no match    }    return true;                // Found a match for every aspect  }