class MutableCharArray implements CharSequence, Cloneable {

  @Override
  public boolean equals(Object other) {
    if (other == this) return true;

    if (other instanceof MutableCharArray) {
      final MutableCharArray otherArray = (MutableCharArray) other;

      // Compare hashes first, then values.
      if (this.length == otherArray.length && this.hashCode() == otherArray.hashCode()) {
        int j = otherArray.start;
        int k = start;

        for (int i = this.length - 1; i >= 0; i--, j++, k++) {
          if (otherArray.buffer[j] != buffer[k]) {
            return false;
          }
        }

        return true;
      }
    }

    return false;
  }

  public  MutableCharArray();
  public  MutableCharArray(CharSequence seq);
  public  MutableCharArray(char[] buffer);
  public  MutableCharArray(char[] buffer, int start, int length);

}