// Define that the "getRate()" method must call exactly one time !
EasyMock.expectLastCall().once();
// Initialize the mock object before to use it
EasyMock.replay(exchangeRateMock);
// Define a reference object to valid the test
Currency cRefObj = new Currency(3.75, "EUR");
// Define a test object
Currency cTestObj = new Currency(2.50, "USD");
// Run the test using the mock as exchange rate provider
Currency cTestResult = cTestObj.toEuros(exchangeRateMock);
// Make a assertion to valid the test
Assert.assertEquals(cRefObj, cTestResult);
// We verify the method call order on the mock
EasyMock.verify(exchangeRateMock);
}