@Override
    public boolean equals(Object o) {
      if (this == o) return true;
      if (!(o instanceof CharSegment)) return false;

      CharSegment wrapper = (CharSegment)o;

      if (hashCode() != wrapper.hashCode()) return false;
      if (length() != wrapper.length()) return false;

      for (int i = 0; i < length(); i++) {
        if (charAt(i) != wrapper.charAt(i)) {
          return false;
        }
      }

      return true;
    }
@Override
    public boolean equals(Object o)