BufferUtil { public static boolean equals(final DirectBuffer buffer1, final DirectBuffer buffer2) { if (buffer1 instanceof UnsafeBuffer && buffer2 instanceof UnsafeBuffer) { return buffer1.equals(buffer2); } else if (buffer1 instanceof ExpandableArrayBuffer && buffer2 instanceof ExpandableArrayBuffer) { return buffer1.equals(buffer2); } else { return contentsEqual(buffer1, buffer2); } } private  BufferUtil(); static String bufferAsString(final DirectBuffer buffer); static String bufferAsString(
      final DirectBuffer buffer, final int offset, final int length); static DirectBuffer wrapString(final String argument); static boolean equals(final DirectBuffer buffer1, final DirectBuffer buffer2); static boolean contentsEqual(final DirectBuffer buffer1, final DirectBuffer buffer2); static DirectBuffer cloneBuffer(final DirectBuffer src); static DirectBuffer cloneBuffer(
      final DirectBuffer src, final int offset, final int length); static String bufferAsHexString(final BufferWriter writer); static String bufferAsHexString(final BufferWriter writer, final int wrap); static String bufferAsHexString(final DirectBuffer buffer); static String bufferAsHexString(final DirectBuffer buffer, final int wrap); static String bufferAsHexString(
      final DirectBuffer buffer, final int offset, final int length); static String bufferAsHexString(
      final DirectBuffer buffer, final int offset, final int length, final int wrap); static String bytesAsHexString(final byte[] bytes); static String bytesAsHexString(final byte[] bytes, final int wrap); static byte[] bufferAsArray(final DirectBuffer buffer); static MutableDirectBuffer wrapArray(final byte[] array); static MutableDirectBuffer wrapBytes(final int... bytes); static int bufferContentsHash(final DirectBuffer buffer); static boolean startsWith(
      final byte[] prefix,
      final int prefixOffset,
      final int prefixLength,
      final byte[] content,
      int contentOffset,
      final int contentLength); static final int NO_WRAP; static final int DEFAULT_WRAP; }
@Test public void testEquals() { assertThat(BufferUtil.contentsEqual(asBuffer(BYTES1), asBuffer(BYTES1))).isTrue(); assertThat(BufferUtil.contentsEqual(asBuffer(BYTES1), asBuffer(BYTES2))).isFalse(); assertThat(BufferUtil.contentsEqual(asBuffer(BYTES1), asBuffer(BYTES3))).isFalse(); assertThat(BufferUtil.contentsEqual(asBuffer(BYTES3), asBuffer(BYTES1))).isFalse(); }