@Test public void testGoBack() throws Exception { okuki.addGlobalListener(globalListener); gotoAllPlaces(); assertThat(okuki.goBack()).isTrue(); assertThat(okuki.goBack()).isTrue(); assertThat(okuki.goBack()).isFalse(); verify(globalListener, times(2)).onPlace(place1); verify(globalListener, times(2)).onPlace(place2); verify(globalListener).onPlace(place3); verifyNoMoreInteractions(globalListener); }
public boolean goBack() { boolean success = false; if (history.size() > 1) { history.pop(); callPlace(history.peek()); success = true; } return success; }
Okuki { public boolean goBack() { boolean success = false; if (history.size() > 1) { history.pop(); callPlace(history.peek()); success = true; } return success; } }
Okuki { public boolean goBack() { boolean success = false; if (history.size() > 1) { history.pop(); callPlace(history.peek()); success = true; } return success; } Okuki(); }
Okuki { public boolean goBack() { boolean success = false; if (history.size() > 1) { history.pop(); callPlace(history.peek()); success = true; } return success; } Okuki(); static Okuki getDefault(); void gotoPlace(Place place); void gotoPlace(Place place, HistoryAction historyAction); boolean goBack(); Place getCurrentPlace(); void addGlobalListener(GlobalListener listener); void removeGlobalListener(GlobalListener listener); void addPlaceListener(PlaceListener listener); void removePlaceListener(PlaceListener listener); void addBranchListener(final BranchListener listener); void removeBranchListener(BranchListener listener); Deque<Place> getHistory(); }
Okuki { public boolean goBack() { boolean success = false; if (history.size() > 1) { history.pop(); callPlace(history.peek()); success = true; } return success; } Okuki(); static Okuki getDefault(); void gotoPlace(Place place); void gotoPlace(Place place, HistoryAction historyAction); boolean goBack(); Place getCurrentPlace(); void addGlobalListener(GlobalListener listener); void removeGlobalListener(GlobalListener listener); void addPlaceListener(PlaceListener listener); void removePlaceListener(PlaceListener listener); void addBranchListener(final BranchListener listener); void removeBranchListener(BranchListener listener); Deque<Place> getHistory();  }