AbstractActivity implements Activity { @Override public void onShutdown() { if (this.place == null) { throw new IllegalStateException("Activity " + this + " has not been started"); } if (open) { throw new IllegalStateException("Activity " + this + " is open"); } this.place = null; } AbstractActivity(final PlaceManager placeManager); @Override void onStartup(PlaceRequest place); @Override void onOpen(); @Override void onClose(); @Override void onShutdown(); @Override PlaceRequest getPlace(); @Override String toString();  }
@Test(expected = IllegalStateException.class) public void onShutdownShouldFailWhenActivityNotStarted() { getActivityUnderTest().onShutdown(); }