FlumeEventPointer { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + fileID; result = prime * result + offset; return result; } FlumeEventPointer(int fileID, int offset); long toLong(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static FlumeEventPointer fromLong(long value);  }
@Test public void testHashCode() { FlumeEventPointer pointerA = new FlumeEventPointer(1, 1); FlumeEventPointer pointerB = new FlumeEventPointer(1, 1); Assert.assertEquals(pointerA.hashCode(), pointerB.hashCode()); pointerA = new FlumeEventPointer(1, 1); pointerB = new FlumeEventPointer(2, 2); Assert.assertFalse(pointerA.hashCode() == pointerB.hashCode()); }