### Question:
Stepper { public int positionOfIdAfterCurrent(T t) { if (t != null) { Serializable searchId = toId.apply(t); for (int i = step; i < ids.size(); i++) { if (ids.get(i).equals(searchId)) { return i + 1 - step; } } } return -1; } Stepper(Iterable<T> steps, Function<T, Serializable> toId); T next(); int positionOfIdAfterCurrent(T t); boolean isEmpty();  }### Answer:
@Test public void shouldFindPositionOfFirst() throws Exception { List<Step> steps = newArrayList(step("1"), step("2"), step("3")); Stepper<Step> underTest = new Stepper<Step>(steps, toId); final int position = underTest.positionOfIdAfterCurrent(steps.get(0)); assertThat(position, is(1)); }
@Test public void shouldFindPositionOfSecond() throws Exception { List<Step> steps = newArrayList(step("1"), step("2"), step("3")); Stepper<Step> underTest = new Stepper<Step>(steps, toId); final int position = underTest.positionOfIdAfterCurrent(steps.get(1)); assertThat(position, is(2)); }