Line { @Override public int hashCode() { int result = origin.hashCode(); result = 31 * result + direction.hashCode(); return result; } Line();  Line(Vec3 origin, Vec3 direction);  Line(Line line); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); Line set(Vec3 origin, Vec3 direction); Line setToSegment(Vec3 pointA, Vec3 pointB); Vec3 pointAt(double distance, Vec3 result); boolean triStripIntersection(float[] points, int stride, short[] elements, int count, Vec3 result); final Vec3 origin; final Vec3 direction; }
@Test public void testHashCode() throws Exception { Vec3 origin = new Vec3(1, 2, 3); Vec3 direction1 = new Vec3(0, 0, 1); Vec3 direction2 = new Vec3(0, 1, 0); Line line1 = new Line(origin, direction1); Line line2 = new Line(line1); Line line3 = new Line(origin, direction2); int hashCode1 = line1.hashCode(); int hashCode2 = line2.hashCode(); int hashCode3 = line3.hashCode(); assertEquals(hashCode1, hashCode2); assertNotEquals(hashCode1, hashCode3); }