Line { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || this.getClass() != o.getClass()) { return false; } Line that = (Line) o; return this.origin.equals(that.origin) && this.direction.equals(that.direction); } 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 testEquals() throws Exception { Vec3 origin = new Vec3(1, 2, 3); Vec3 direction = new Vec3(0, 0, 1); Line line1 = new Line(origin, direction); Line line2 = new Line(origin, direction); assertEquals("origin", line1.origin, line2.origin); assertEquals("direction", line1.direction, line2.direction); assertTrue("equals", line1.equals(line2)); }
@Test public void testEquals_Null() throws Exception { Vec3 origin = new Vec3(1, 2, 3); Vec3 direction = new Vec3(0, 0, 1); Line line1 = new Line(origin, direction); assertFalse("inequality with null", line1.equals(null)); }
@Test public void testEquals_Inequality() throws Exception { Vec3 origin = new Vec3(1, 2, 3); Vec3 direction = new Vec3(0, 0, 1); Line line1 = new Line(origin, direction); Line line2 = new Line(direction, origin); assertFalse("not equals", line1.equals(line2)); }