Upgrades { public final boolean isUpgradeRequired( int lastId ) { return getLatestAvailableUpgradeId() > lastId; } protected  Upgrades( UpgradeOperation... operations ); final int applyUpgradesSince( int lastId,
                                         Context resources ); final boolean isUpgradeRequired( int lastId ); final int getLatestAvailableUpgradeId(); static final Upgrades STANDARD_UPGRADES; }
@Test public void shouldCorrectlyDetermineIfUpgradeIsRequired() throws Exception { assertTrue(testUpgrades.isUpgradeRequired(-1)); assertTrue(testUpgrades.isUpgradeRequired(0)); assertTrue(testUpgrades.isUpgradeRequired(1)); assertTrue(testUpgrades.isUpgradeRequired(2)); assertTrue(testUpgrades.isUpgradeRequired(3)); assertFalse(testUpgrades.isUpgradeRequired(4)); assertFalse(testUpgrades.isUpgradeRequired(5)); }