### Question:
HistoryList { public void goBackTo(T t) { while (!getCurrentHistoryItem().equals(t) && hasPrevious()) { goBack(); } } HistoryList(int size, Consumer<T> itemSelectedCallback);  HistoryList(int size, BiConsumer<T, T> itemSelectedCallback); void setAllowDuplicates(boolean allowDuplicates); void setAllowNulls(boolean allowNulls); void add(T t); boolean hasNext(); boolean hasPrevious(); void goBack(); void goBackTo(T t); void goForward(); void goForwardTo(T t); T getCurrentHistoryItem(); List<T> getPreviousHistoryItems(); List<T> getNextHistoryItems(); void clear(); int size(); @Override String toString();  }### Answer:
@Test public void testBackToItem() { addHistory(A); addHistory(B); addHistory(C); historyList.goBackTo(A); assertCurrentItem(A); }