Upgrades { public final int getLatestAvailableUpgradeId() { return operations.isEmpty() ? EMPTY_UPGRADES_ID : operations.get(operations.size() - 1).getId(); } 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 shouldReturnLatestAvailableUpgradeId() throws Exception { assertEquals(4, testUpgrades.getLatestAvailableUpgradeId()); assertEquals(Upgrades.EMPTY_UPGRADES_ID, new Upgrades().getLatestAvailableUpgradeId()); }