### Question:
NBackupHostsStrategy implements PowerButtonStrategy { @Override public List<Host> getPowerButtonsToPress(ClusterState clusterState) { if (currentNumberOfBackUpHosts(clusterState) > desiredBackupHosts) { return hostSelector.selectHostsToBeTurnedOff( clusterState.getHostsWithoutVmsAndSwitchedOn(), currentNumberOfBackUpHosts(clusterState) - desiredBackupHosts); } return hostSelector.selectHostsToBeTurnedOn( clusterState.getTurnedOffHosts(), desiredBackupHosts - currentNumberOfBackUpHosts(clusterState)); } NBackupHostsStrategy(int desiredBackupHosts, HostSelector hostSelector); @Override List<Host> getPowerButtonsToPress(ClusterState clusterState);  }### Answer:
@Test public void getPowerButtonsReturnsAnEmptyListWhenThereAreNBackupHosts() { assertEquals(0, nBackupHostsStrategy.getPowerButtonsToPress( getClusterStateWithTheDesiredNumberOfBackupHosts()).size()); }
@Test public void getPowerButtonReturnsHostsWhenThereAreMoreBackupsThanNeeded() { assertEquals(1, nBackupHostsStrategy.getPowerButtonsToPress( getClusterStateWithMoreBackupsThanNeeded()).size()); }
@Test public void getPowerButtonReturnsHostsWhenThereAreLessBackupsThanNeeded() { assertEquals(1, nBackupHostsStrategy.getPowerButtonsToPress( getClusterStateWithLessBackupsThanNeeded()).size()); }