@Test public void onDuplicateSelectionDoesNotUpdate() { Identity identity = identity(); configuration.selectIdentity(identity); resetUpdates(); configuration.selectIdentity(identity); assertFalse("selectIdentity triggered update even though identity was not changed", wasUpdated()); }
@Override public void selectIdentity(Identity identity) { if (identity == null && this.identity != null || identity != null && !identity.equals(this.identity)) { setChanged(); } this.identity = identity; notifyObservers(identity); }
DefaultClientConfiguration extends Observable implements ClientConfiguration { @Override public void selectIdentity(Identity identity) { if (identity == null && this.identity != null || identity != null && !identity.equals(this.identity)) { setChanged(); } this.identity = identity; notifyObservers(identity); } }
DefaultClientConfiguration extends Observable implements ClientConfiguration { @Override public void selectIdentity(Identity identity) { if (identity == null && this.identity != null || identity != null && !identity.equals(this.identity)) { setChanged(); } this.identity = identity; notifyObservers(identity); } DefaultClientConfiguration(); }
DefaultClientConfiguration extends Observable implements ClientConfiguration { @Override public void selectIdentity(Identity identity) { if (identity == null && this.identity != null || identity != null && !identity.equals(this.identity)) { setChanged(); } this.identity = identity; notifyObservers(identity); } DefaultClientConfiguration(); @Override boolean hasAccount(); @Override Account getAccount(); @Override void setAccount(Account account); @Override void onSetAccount(Consumer<Account> consumer); @Override Identity getSelectedIdentity(); @Override void selectIdentity(Identity identity); @Override void onSelectIdentity(Consumer<Identity> consumer); @Override ObservableList<BoxSyncConfig> getBoxSyncConfigs(); @Override Date getLastDropPoll(Identity identity); @Override void setLastDropPoll(Identity identity, Date lastDropPoll); @Override HashMap<String, Date> getLastDropMap(); @Override void setLastDropMap(HashMap<String, Date> lastDropMap); @Override synchronized ShareNotifications getShareNotification(Identity identity); @Override boolean hasSelectedIdentity(); @Override void setShareNotifications(Map<String, ShareNotifications> shareNotifications); @Override Map<String, ShareNotifications> getShareNotifications(); @Override boolean hasDeviceId(); @Override void setDeviceId(String deviceId); @Override String getDeviceId(); }
DefaultClientConfiguration extends Observable implements ClientConfiguration { @Override public void selectIdentity(Identity identity) { if (identity == null && this.identity != null || identity != null && !identity.equals(this.identity)) { setChanged(); } this.identity = identity; notifyObservers(identity); } DefaultClientConfiguration(); @Override boolean hasAccount(); @Override Account getAccount(); @Override void setAccount(Account account); @Override void onSetAccount(Consumer<Account> consumer); @Override Identity getSelectedIdentity(); @Override void selectIdentity(Identity identity); @Override void onSelectIdentity(Consumer<Identity> consumer); @Override ObservableList<BoxSyncConfig> getBoxSyncConfigs(); @Override Date getLastDropPoll(Identity identity); @Override void setLastDropPoll(Identity identity, Date lastDropPoll); @Override HashMap<String, Date> getLastDropMap(); @Override void setLastDropMap(HashMap<String, Date> lastDropMap); @Override synchronized ShareNotifications getShareNotification(Identity identity); @Override boolean hasSelectedIdentity(); @Override void setShareNotifications(Map<String, ShareNotifications> shareNotifications); @Override Map<String, ShareNotifications> getShareNotifications(); @Override boolean hasDeviceId(); @Override void setDeviceId(String deviceId); @Override String getDeviceId();  }