text: public boolean equals(Object other) {if (!(other instanceof DoubleBuffer)) {return false;}DoubleBuffer otherBuffer = (DoubleBuffer) other;if (remaining() != otherBuffer.remaining()) {return false;}int myPosition = position;int otherPosition = otherBuffer.position;boolean equalSoFar = true;while (equalSoFar && (myPosition < limit)) {double a = get(myPosition++);double b = otherBuffer.get(otherPosition++);equalSoFar = a == b || (a != a && b != b);}return equalSoFar;}