### Question:
PhysicalMachineResource extends AbstractResource { @GET public PhysicalMachinesDto getMonitoredMachines( @QueryParam(ADDRESS_QUERY_PARAM) String physicalMachineAddress) { checkSystem(); Set<PhysicalMachine> pms = null; if (physicalMachineAddress == null) { pms = dao.findAllPhysicalMachines(); } else { physicalMachineAddress = decodeParameter(physicalMachineAddress); PhysicalMachine pm = dao.findPhysicalMachineByAddress(physicalMachineAddress); if (pm == null) { throw new VSMException(Status.NOT_FOUND, "There is no monitored machine with address " + physicalMachineAddress); } pms = new HashSet<PhysicalMachine>(); pms.add(pm); } PhysicalMachinesDto dto = new PhysicalMachinesDto(); for (PhysicalMachine pm : pms) { dto.add(toDto(pm)); } return dto; } PhysicalMachineResource(); @GET PhysicalMachinesDto getMonitoredMachines(
        @QueryParam(ADDRESS_QUERY_PARAM) String physicalMachineAddress); @POST PhysicalMachineDto monitor(final PhysicalMachineDto physicalMachine,
        @HeaderParam(AUTH_HEADER) final String auth); @DELETE @Path(PHYSICALMACHINE_PATH) void shutdown(@PathParam(PHYSICALMACHINE_PARAM) String physicalMachineId); @GET @Path(VIRTUALMACHINE_PATH) void getState(@PathParam(PHYSICALMACHINE_PARAM) String physicalMachineId,
        @PathParam(VIRTUALMACHINE_PARAM) String virtualMachineName); @DELETE @Path(VIRTUALMACHINE_PATH) void invalidateLastKnownState(
        @PathParam(PHYSICALMACHINE_PARAM) String physicalMachineId,
        @PathParam(VIRTUALMACHINE_PARAM) String virtualMachineName); static final String PHYSICALMACHINES_PATH; static final String PHYSICALMACHINE_PARAM; static final String PHYSICALMACHINE_PATH; static final String VIRTUALMACHINE_PARAM; static final String VIRTUALMACHINE_PATH; }### Answer:
@Test public void test_getMonitoredMachineUnexisting() { try { pmResource.getMonitoredMachines("10.60.1.78"); fail("Physical machine with adddress 10.60.1.78 should not exist"); } catch (VSMException ex) { assertEquals(ex.getResponse().getStatus(), Status.NOT_FOUND.getStatusCode()); } }