ArcsSet extends AbstractRegion<Sphere1D, Sphere1D> implements Iterable<double[]> { public Iterator<double[]> iterator() { return new SubArcsIterator(); } ArcsSet(final double tolerance);  ArcsSet(final double lower, final double upper, final double tolerance);  ArcsSet(final BSPTree<Sphere1D> tree, final double tolerance);  ArcsSet(final Collection<SubHyperplane<Sphere1D>> boundary, final double tolerance); @Override ArcsSet buildNew(final BSPTree<Sphere1D> tree); @Override BoundaryProjection<Sphere1D> projectToBoundary(final Point<Sphere1D> point); List<Arc> asList(); Iterator<double[]> iterator(); Side side(final Arc arc); Split split(final Arc arc);  }
@Test public void testIteration() { ArcsSet set = (ArcsSet) new RegionFactory<Sphere1D>().difference(new ArcsSet(1.0, 6.0, 1.0e-10), new ArcsSet(3.0, 5.0, 1.0e-10)); Iterator<double[]> iterator = set.iterator(); try { iterator.remove(); Assert.fail("an exception should have been thrown"); } catch (UnsupportedOperationException uoe) { } Assert.assertTrue(iterator.hasNext()); double[] a0 = iterator.next(); Assert.assertEquals(2, a0.length); Assert.assertEquals(1.0, a0[0], 1.0e-10); Assert.assertEquals(3.0, a0[1], 1.0e-10); Assert.assertTrue(iterator.hasNext()); double[] a1 = iterator.next(); Assert.assertEquals(2, a1.length); Assert.assertEquals(5.0, a1[0], 1.0e-10); Assert.assertEquals(6.0, a1[1], 1.0e-10); Assert.assertFalse(iterator.hasNext()); try { iterator.next(); Assert.fail("an exception should have been thrown"); } catch (NoSuchElementException nsee) { } }