### Question:
JustInTimeStrategy implements PowerButtonStrategy { @Override public List<Host> getPowerButtonsToPress(ClusterState clusterState) { return clusterState.getHostsWithoutVmsAndSwitchedOn(); } JustInTimeStrategy(); @Override List<Host> getPowerButtonsToPress(ClusterState clusterState);  }### Answer:
@Test public void getPowerButtonsToPressReturnsTheServersThatAreOnAndDoNotContainVms() { List<Host> hostsToPress = justInTimeStrategy.getPowerButtonsToPress( getClusterStateWithSomeOnServersWithoutVms()); List<String> hostNamesPowerButtonsToPress = new ArrayList<>(); for (Host host: hostsToPress) { hostNamesPowerButtonsToPress.add(host.getHostname()); } assertTrue(hostNamesPowerButtonsToPress.contains("host3")); assertTrue(hostNamesPowerButtonsToPress.contains("host4")); }
@Test public void getPowerButtonsToPressReturnsEmptyListWhenThereAreNoOnHostsWithoutVms() { assertEquals(0, justInTimeStrategy.getPowerButtonsToPress(getClusterStateWithoutServersOnWithoutVms()).size()); }