@Override
    public boolean equals(Object object) {
        if (object == this ) {
            return true;
        }
       if (object instanceof ResizableDoubleArray == false) {
            return false;
        }
       synchronized(this) {
           synchronized(object) {
               boolean result = true;
               ResizableDoubleArray other = (ResizableDoubleArray) object;
               result = result && (other.initialCapacity == initialCapacity);
               result = result && (other.contractionCriteria == contractionCriteria);
               result = result && (other.expansionFactor == expansionFactor);
               result = result && (other.expansionMode == expansionMode);
               result = result && (other.numElements == numElements);
               result = result && (other.startIndex == startIndex);
               if (!result) {
                   return false;
               } else {
                   return Arrays.equals(internalArray, other.internalArray);
               }
           }
       }
    }