public void testComplexNext() { List<Point> expected = buildComplex(); List<Point> actual = new ArrayList<Point>(); MoveablePoint point = SimpleMoveablePoint.startOf(root); actual.add(SimplePoint.at(point)); while (point.hasNext()) { point.next(); actual.add(SimplePoint.at(point)); } assertEquals(expected, actual); }
public void testComplexPrevious() { List<Point> expected = buildComplex(); Collections.reverse(expected); List<Point> actual = new ArrayList<Point>(); MoveablePoint point = SimpleMoveablePoint.endOf(root); actual.add(SimplePoint.at(point)); while (point.hasPrevious()) { point.previous(); actual.add(SimplePoint.at(point)); } assertEquals(expected, actual); }