### Question:
HighAvailabilitySlaves implements Lifecycle, Slaves { @Override public void init() { life.init(); clusterListener = new HASClusterListener(); cluster.addClusterListener( clusterListener ); } HighAvailabilitySlaves( ClusterMembers clusterMembers, Cluster cluster, SlaveFactory slaveFactory,
            HostnamePort me ); @Override Iterable<Slave> getSlaves(); @Override void init(); @Override void start(); @Override void stop(); @Override void shutdown();  }### Answer:
@Test public void shouldRegisterItselfOnMonitors() { ClusterMembers clusterMembers = mock( ClusterMembers.class ); Cluster cluster = mock( Cluster.class ); SlaveFactory slaveFactory = mock( SlaveFactory.class ); new HighAvailabilitySlaves( clusterMembers, cluster, slaveFactory, new HostnamePort( null, 0 ) ).init(); verify( cluster ).addClusterListener( any( ClusterListener.class ) ); }