INATEngine natEngine = createMock(INATEngine.class);
String error = "VirtualBox error: Argument slot is invalid "
+ "(must be slot < RT_ELEMENTS(mNetworkAdapters)) (0x80070057)";
VBoxException invalidSlotException = new VBoxException(
createNiceMock(Throwable.class), error);
expect(machine.getNetworkAdapter(slotId))
.andThrow(invalidSlotException);
replay(machine, iNetworkAdapter, natEngine);