I want to use return vale of a expectation to add to one more expection. I have a m_accountProcessor object which has interface createAccount to create a new account and returns a Account object. I want to save this object and add it to one more expectation for encode function call. How can I save the value?
m_context.checking(new Expectations() {{
one(m_accountProcessor).createAccount(CUSTOMER_DETAILS);
//How can I save the return value of createAccount's Account object
one(m_accountProcessor).encode(/*AccountObject*/);
}}