@Test(expected = AssertionError.class) public void cannot_ask_latestVersionNumber_of_empty_state() { GlobalGroupState emptyState = new GlobalGroupState(null, emptyList()); emptyState.getLatestRevisionNumber(); }
int getLatestRevisionNumber() { if (serverHistory.isEmpty()) { if (localState == null) { throw new AssertionError(); } return localState.getRevision(); } return serverHistory.get(serverHistory.size() - 1).getRevision(); }
GlobalGroupState { int getLatestRevisionNumber() { if (serverHistory.isEmpty()) { if (localState == null) { throw new AssertionError(); } return localState.getRevision(); } return serverHistory.get(serverHistory.size() - 1).getRevision(); } }
GlobalGroupState { int getLatestRevisionNumber() { if (serverHistory.isEmpty()) { if (localState == null) { throw new AssertionError(); } return localState.getRevision(); } return serverHistory.get(serverHistory.size() - 1).getRevision(); } GlobalGroupState(@Nullable DecryptedGroup localState,
                   @NonNull List<ServerGroupLogEntry> serverHistory); }
GlobalGroupState { int getLatestRevisionNumber() { if (serverHistory.isEmpty()) { if (localState == null) { throw new AssertionError(); } return localState.getRevision(); } return serverHistory.get(serverHistory.size() - 1).getRevision(); } GlobalGroupState(@Nullable DecryptedGroup localState,
                   @NonNull List<ServerGroupLogEntry> serverHistory);  }
GlobalGroupState { int getLatestRevisionNumber() { if (serverHistory.isEmpty()) { if (localState == null) { throw new AssertionError(); } return localState.getRevision(); } return serverHistory.get(serverHistory.size() - 1).getRevision(); } GlobalGroupState(@Nullable DecryptedGroup localState,
                   @NonNull List<ServerGroupLogEntry> serverHistory);   }