PlaneParallelLineGenerator implements ParallelLineGenerator { @Override public Line nextLine() { if (cycle == 0) { shuffle(order, random); uOffset = random.nextDouble() * sectionSize; tOffset = random.nextDouble() * sectionSize; } final long uSection = order[cycle] / sections; final long tSection = order[cycle] - uSection * sections; final double u = uSection * sectionSize + uOffset; final double t = tSection * sectionSize + tOffset; final Vector3dc point = createOrigin(t, u); cycle++; if (cycle >= order.length) { cycle = 0; } return new Line(point, direction); } <I extends Interval> PlaneParallelLineGenerator(final I interval, final Quaterniondc direction,
														   final BinaryHybridCFI1<Vector3d, Quaterniondc, Vector3d> rotateOp,
														   final long sections); @Override Line nextLine(); @Override Vector3dc getDirection(); void setSeed(final long seed); void reset();  }
@Test public void testFirstQuadrantChanges() { PlaneParallelLineGenerator generator = new PlaneParallelLineGenerator(IMG, IDENTITY, rotateOp, 2L); final int initialQuadrant = identifyQuadrant(generator.nextLine().point); final int max = 100_000; int generated = 0; boolean changed = false; while (generated < max) { generator = new PlaneParallelLineGenerator(IMG, IDENTITY, rotateOp, 2L); final int quadrant = identifyQuadrant(generator.nextLine().point); if (quadrant != initialQuadrant) { changed = true; } generated++; } assertTrue("All the lines came from the same quadrant. ", changed); }