@Test public void testRecentHistoryShouldNotContainEmptyStates() throws Exception { addState(""); addState("1"); addState("12"); addState(""); addState(""); addState("34"); addState(""); final List<HistoryState> states = history.getRecent(); assertEquals(2, states.size()); assertEquals("34", states.get(0).editor.getTextString()); assertEquals("12", states.get(1).editor.getTextString()); }
@Nonnull public List<HistoryState> getRecent() { return getRecent(true); }
History { @Nonnull public List<HistoryState> getRecent() { return getRecent(true); } }
History { @Nonnull public List<HistoryState> getRecent() { return getRecent(true); } @Inject  History(); }
History { @Nonnull public List<HistoryState> getRecent() { return getRecent(true); } @Inject  History(); void init(@NonNull Executor initThread); void addRecent(@Nonnull HistoryState state); void updateSaved(@Nonnull HistoryState state); @Nonnull List<HistoryState> getRecent(); @Nonnull List<HistoryState> getSaved(); void clearRecent(); void clearSaved(); void undo(); void redo(); void removeSaved(@Nonnull HistoryState state); @Subscribe void onDisplayChanged(@Nonnull Display.ChangedEvent e); boolean isLoaded(); void runWhenLoaded(@NonNull Runnable runnable); }
History { @Nonnull public List<HistoryState> getRecent() { return getRecent(true); } @Inject  History(); void init(@NonNull Executor initThread); void addRecent(@Nonnull HistoryState state); void updateSaved(@Nonnull HistoryState state); @Nonnull List<HistoryState> getRecent(); @Nonnull List<HistoryState> getSaved(); void clearRecent(); void clearSaved(); void undo(); void redo(); void removeSaved(@Nonnull HistoryState state); @Subscribe void onDisplayChanged(@Nonnull Display.ChangedEvent e); boolean isLoaded(); void runWhenLoaded(@NonNull Runnable runnable); static final String OLD_HISTORY_PREFS_KEY; }