public boolean equals(Object o) {
      if (o instanceof State) {
        State s = (State) o;
        if (s.s1.size() != s1.size() || s.s2.size() != s2.size()) {
          return false;
        }
        for (int x = 0; x < s1.size(); x++) {
          if (s1.get(x) != s.s1.get(x)) {
            return false;
          }
        }
        for (int x = 0; x < s2.size(); x++) {
          if (s2.get(x) != s.s2.get(x)) {
            return false;
          }
        }
        return true;
      }
      return false;
    }