expect(vBox.createMachine(anyString(), eq(vmName), groups, anyString(), anyString())).andReturn(createdMachine)
.anyTimes();
vBox.registerMachine(createdMachine);
expect(vBox.findMachine(vmName)).andReturn(createdMachine).anyTimes();
expect(manager.getSessionObject()).andReturn(session);
expect(session.getMachine()).andReturn(createdMachine);
createdMachine.lockMachine(session, LockType.Write);
createdMachine.setMemorySize(1024l);
createdMachine.saveSettings();