@Test public void testRepeatedAdds_AllowDuplicates_ItemGetsAdded() { historyList.setAllowDuplicates(true); addHistory(A); addHistory(B); addHistory(C); assertHistory(A, B, C); addHistory(A); assertHistory(A, B, C, A); }
public void setAllowDuplicates(boolean allowDuplicates) { this.allowDuplicates = allowDuplicates; }
HistoryList { public void setAllowDuplicates(boolean allowDuplicates) { this.allowDuplicates = allowDuplicates; } }
HistoryList { public void setAllowDuplicates(boolean allowDuplicates) { this.allowDuplicates = allowDuplicates; } HistoryList(int size, Consumer<T> itemSelectedCallback); }
HistoryList { public void setAllowDuplicates(boolean allowDuplicates) { this.allowDuplicates = allowDuplicates; } 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 setAllowDuplicates(boolean allowDuplicates) { this.allowDuplicates = allowDuplicates; } 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();  }