MutualClusterValidator { public void validate() throws ClusterConfigMismatchException { if (!Objects.equals(major.getName(), minor.getName())) { fail(CLUSTER_NAME, major.getName(), minor.getName()); } if (!Objects.equals(major.getClientLeaseDuration(), minor.getClientLeaseDuration())) { fail(CLIENT_LEASE_DURATION, major.getClientLeaseDuration(), minor.getClientLeaseDuration()); } if (!Objects.equals(major.getClientReconnectWindow(), minor.getClientReconnectWindow())) { fail(CLIENT_RECONNECT_WINDOW, major.getClientReconnectWindow(), minor.getClientReconnectWindow()); } if (!Objects.equals(major.getFailoverPriority(), minor.getFailoverPriority())) { fail(FAILOVER_PRIORITY, major.getFailoverPriority(), minor.getFailoverPriority()); } if (!Objects.equals(major.getOffheapResources(), minor.getOffheapResources())) { fail(OFFHEAP_RESOURCES, major.getOffheapResources(), minor.getOffheapResources()); } if (!Objects.equals(major.getSecurityAuthc(), minor.getSecurityAuthc())) { fail(SECURITY_AUTHC, major.getSecurityAuthc(), minor.getSecurityAuthc()); } if (!Objects.equals(major.getSecuritySslTls(), minor.getSecuritySslTls())) { fail(SECURITY_SSL_TLS, major.getSecuritySslTls(), minor.getSecuritySslTls()); } if (!Objects.equals(major.getSecurityWhitelist(), minor.getSecurityWhitelist())) { fail(SECURITY_WHITELIST, major.getSecurityWhitelist(), minor.getSecurityWhitelist()); } } MutualClusterValidator(Cluster major, Cluster minor); void validate();  }
@Test public void testNoMismatches() { Cluster one = Testing.newTestCluster().setSecurityAuthc("file").setName("cluster"); Cluster two = one.clone(); new MutualClusterValidator(one, two).validate(); }