### Question:
HistoryList { public void setAllowNulls(boolean allowNulls) { this.allowsNulls = allowNulls; } 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 testNull_NullAllowed() { historyList.setAllowNulls(true); addHistory(A); addHistory(null); assertHistory(A, null); addHistory(null); assertHistory(A, null); }
@Test public void testNull_WhenEmpty() { historyList.setAllowNulls(true); addHistory(null); assertHistory(); }
@Test public void testNull_GoBack() { historyList.setAllowNulls(true); addHistory(A); addHistory(null); assertHistory(A, null); addHistory(B); assertHistory(A, B); addHistory(null); assertHistory(A, B, null); }
@Test public void testNull_GetCurrentHistoryItem() { historyList.setAllowNulls(true); addHistory(A); addHistory(B); addHistory(null); assertHistory(A, B, null); assertNotified(null); }
@Test public void testNull_GetPreviousHistoryItems() { historyList.setAllowNulls(true); addHistory(A); addHistory(B); addHistory(null); assertPreviousItems(B, A); }
@Test public void test_AddHistory_AddNull_AddHistory_DoesntAddSameItemTwice_NullAllowed() { historyList.setAllowNulls(true); addHistory(A); addHistory(B); assertHistory(A, B); addHistory(B); assertHistory(A, B); addHistory(null); assertHistory(A, B, null); addHistory(B); assertHistory(A, B); }