Example #1
0
  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);
  }
Example #2
0
  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);
  }