UpdateCheck implements Updater { @Override public UpdateAvailability hasUpdate() { assertCheckHasRun(); return latestUpdate.isUpdateFrom(currentVersion); } UpdateCheck(UpdateConnection updateConnection); @Override UpdateAvailability hasUpdate(); @Override Version getInstalledVersion(); @Override Version getLatestVersion(); @Override OngoingInstallation updateToLatestVersion(); @Override synchronized void runCheck();  }
@Test(expected = IllegalStateException.class) public void expectsCheckToBeRunBeforeQueryingAvailability() throws Exception { UpdateCheck updateCheck = createUpdateCheck(); updateCheck.hasUpdate(); }