HistoryChain { @Nullable HistoryChain<S> getPrevious() { return previous; } HistoryChain(@Nullable HistoryChain<S> previous, @Nullable S state);   }
@Test void testGetPrevious() { HistoryChain<String> prev = new HistoryChain<>(null, "payload1"); HistoryChain<String> historyChain = prev.append("payload2"); assertEquals(prev, historyChain.getPrevious()); }