### Question:
HostsManager { public List<Host> getHosts() { refreshHostsMonitoringInfo(); return Collections.unmodifiableList(hosts); } HostsManager(List<Host> hosts); List<Host> getHosts(); Host getHost(String hostname); void pressHostPowerButton(String hostname);  }### Answer:
@Test public void getHosts() { List<Host> hosts = new ArrayList<>(); HostFake host1 = new HostFake("host1", 1, 1024, 10, 0, 0, 0); HostFake host2 = new HostFake("host2", 2, 2048, 20, 0, 0, 0); hosts.add(host1); hosts.add(host2); HostsManager hostsManager = new HostsManager(hosts); assertTrue(hostsManager.getHosts().contains(host1) && hostsManager.getHosts().contains(host2)); }
@Test public void getHostsReturnsEmptyWhenThereAreNoHosts() { HostsManager hostsManager = new HostsManager(new ArrayList<Host>()); assertTrue(hostsManager.getHosts().isEmpty()); }