### Question:
MonitorManager { public VirtualMachine subscribe(final String physicalMachineAddress, final Type type, final String virtualMachineName) throws MonitorException { LOGGER.info("Subscribing to {} on {}", virtualMachineName, physicalMachineAddress); PhysicalMachine pm = getPhysicalMachine(physicalMachineAddress); if (dao.findVirtualMachineByName(virtualMachineName) != null) { throw new MonitorException("Virtual machine " + virtualMachineName + " already persisted."); } VirtualMachine vm = new VirtualMachine(); vm.setName(virtualMachineName); vm.setPhysicalMachine(pm); vm.setLastKnownState(VMEventType.UNKNOWN.name()); dao.save(vm); return vm; } MonitorManager(); PhysicalMachine monitor(final String physicalMachineAddress, final Type type,
        final String username, final String password); void createAndStartMonitor(final String physicalMachineAddress, final Type type,
        final String username, final String password); void shutdown(final String physicalMachineAddress, final Type type); void stopAllMonitors(); VirtualMachine subscribe(final String physicalMachineAddress, final Type type,
        final String virtualMachineName); void unsubscribe(final String physicalMachineAddress, final Type type,
        final String virtualMachineName); void getState(final String physicalMachineAddress, final Type type,
        final String virtualMachineName); void invalidateLastKnownState(final String physicalMachineAddress, final Type type,
        final String virtualMachineName);  }### Answer:
@Test(expectedExceptions = MonitorException.class) public void test_subscribeUnexistingPhysicalMachine() throws Exception { String machineName = UUID.randomUUID().toString(); monitorManager.subscribe("10.60.1.11", SingleMachineMonitor.TYPE, machineName); }