Line { public Line set(Vec3 origin, Vec3 direction) { if (origin == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "Line", "set", "The origin is null")); } if (direction == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "Line", "set", "The direction is null")); } this.origin.set(origin); this.direction.set(direction); return this; } 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 testSet() throws Exception { Vec3 origin = new Vec3(1, 2, 3); Vec3 direction = new Vec3(0, 0, 1); Line line = new Line(); line.set(origin, direction); assertEquals("origin", origin, line.origin); assertEquals("direction", direction, line.direction); }
@Test(expected = IllegalArgumentException.class) public void testSet_NullFirst() throws Exception { Line line = new Line(); line.set(null, new Vec3()); fail("Expected an IllegalArgumentException to be thrown."); }
@Test(expected = IllegalArgumentException.class) public void testSet_NullSecond() throws Exception { Line line = new Line(); line.set(new Vec3(), null); fail("Expected an IllegalArgumentException to be thrown."); }