ReplicationBroker.java:
In computeInitialServerStatus(), used early exits.
In computeBestServerForWeight(), extracted methods computeBestServerWhenNotConnected() and computeBestServerWhenConnected().
Changed replicationServerUrls from Collection<String> to Set<String>.
Removed useless field initialization to null.
Renamed _publish() to publish() + reduced local variables scope.
In receive(), renamed local variable replicationServerID to previousRsServerID and used this one more rather than the field.
In changeConfig(), used Set.equals().
Changed getReplicationMonitor() to getReplicationMonitorInstanceName().
ReplicationDomain.java:
Consequence of the change to ReplicationBroker.getReplicationMonitor(), inlined getReplicationMonitorInstanceName().
Consequence of the change to ReplicationBroker.replicationServerUrls.
TestCaseUtils.java:
Moved newSet(), newSortedSet(), newList() here from test classes.
*Test.java:
Consequence of the changes to ReplicationBroker.replicationServerUrls.