Buffer implements Comparable<Buffer> { @Override public int hashCode() { long h = 1; final long l = limit(); for (long i = position(); i < l; i++) h = 31 * h + get(i); return (int) h; }  @NotNull static Buffer from(
            @NotNull
            final ByteBuffer buf); @NotNull static Buffer from(
            @NotNull
            final byte[] buf); @NotNull static Buffer from(
            @NotNull
            final FileChannel file); @NotNull static Buffer mmap(
            @NotNull
            final File f,
            @SuppressWarnings("SameParameterValue")
            final boolean forceToMemory); @NotNull static Buffer mmap(
            @NotNull
            final File f); abstract long position(); abstract Buffer position(final long position); abstract Buffer advance(final long bytes); abstract long limit(); abstract boolean hasRemaining(); abstract long remaining(); byte[] toByteArray(); abstract Buffer get(byte[] dst, int offset, int length); abstract Buffer get(byte[] dst); abstract byte get(); abstract byte get(long index); abstract int getInt(); abstract int getInt(long index); abstract long getLong(); abstract long getLong(long index); abstract char getChar(); abstract char getChar(long index); abstract short getShort(); abstract short getShort(long index); Buffer slice(); Buffer slice(long size); abstract Buffer slice(long from, long size); @Override boolean equals(final Object ob); @Override int hashCode(); @Override int compareTo(
            @NotNull
            final Buffer that); @Override String toString();  }
@Test public void testEqual() { final Buffer buf1 = bufferOf("superMegaBuffer"); assertEquals(buf1, buf1); final Buffer buf2 = bufferOf("superMegaBuffer"); assertEquals(buf1.hashCode(), buf2.hashCode()); assertEquals(buf1, buf2); }
@Test public void testNotEqual() { final Buffer buf1 = bufferOf("superMegaBuffer1"); assertNotEquals(buf1, "Some string"); final Buffer buf2 = bufferOf("superMegaBuffer2"); assertNotEquals(buf1.hashCode(), buf2.hashCode()); assertNotEquals(buf1, buf2); assertNotEquals(bufferOf("short"), bufferOf("long")); }