}
@Test
public void testFilterVisiblePositionIncludingFirstAndLast() throws Exception {
List<NavigationPosition> positions = new ArrayList<NavigationPosition>();
NavigationPosition one = asPosition(0.0, 0.0);
positions.add(one);
NavigationPosition two = asPosition(0.1, 0.1);
positions.add(two);
NavigationPosition threeNotVisible = asPosition(45.0, 45.0);
positions.add(threeNotVisible);
NavigationPosition fourNotVisible = asPosition(45.1, 45.1);
positions.add(fourNotVisible);
NavigationPosition fiveNotVisible = asPosition(45.1, 45.1);
positions.add(fiveNotVisible);
NavigationPosition six = asPosition(0.2, 0.2);
positions.add(six);
NavigationPosition seven = asPosition(0.3, 0.3);
positions.add(seven);
List<NavigationPosition> result = reducer.filterVisiblePositions(positions, 1.0, true);
assertEquals(6, result.size());
assertEquals(one, result.get(0));