@Test public void testRepeatedAdds_WhenInMiddleOfHistory_NoChanges() { addHistory(A); addHistory(B); addHistory(C); assertHistory(A, B, C); goBack(); assertHistory(A, B, C); assertNotified(B); addHistory(B); assertHistory(A, B, C); assertNotified(B); }
public void goBack() { if (historyIndex == 0) { return; } T t = historyStack.get(--historyIndex); dropNull(); broadcast(t); }
HistoryList { public void goBack() { if (historyIndex == 0) { return; } T t = historyStack.get(--historyIndex); dropNull(); broadcast(t); } }
HistoryList { public void goBack() { if (historyIndex == 0) { return; } T t = historyStack.get(--historyIndex); dropNull(); broadcast(t); } HistoryList(int size, Consumer<T> itemSelectedCallback); }
HistoryList { public void goBack() { if (historyIndex == 0) { return; } T t = historyStack.get(--historyIndex); dropNull(); broadcast(t); } HistoryList(int size, Consumer<T> itemSelectedCallback); void setAllowDuplicates(boolean allowDuplicates); void setAllowNulls(boolean allowNulls); void add(T t); boolean hasNext(); boolean hasPrevious(); void goBack(); void goForward(); T getCurrentHistoryItem(); List<T> getPreviousHistoryItems(); List<T> getNextHistoryItems(); void clear(); int size(); @Override String toString(); }
HistoryList { public void goBack() { if (historyIndex == 0) { return; } T t = historyStack.get(--historyIndex); dropNull(); broadcast(t); } HistoryList(int size, Consumer<T> itemSelectedCallback); void setAllowDuplicates(boolean allowDuplicates); void setAllowNulls(boolean allowNulls); void add(T t); boolean hasNext(); boolean hasPrevious(); void goBack(); void goForward(); T getCurrentHistoryItem(); List<T> getPreviousHistoryItems(); List<T> getNextHistoryItems(); void clear(); int size(); @Override String toString();  }