Details
Description
Code sample:
SomeObject obj = createMock(SomeObject.class);
Capture<Map> cap1 = new Capture();
Capture<Map> cap2 = new Capture();
obj.doSomething(eq("test"), capture(cap1));
obj.doSomething(eq("anotherTest"), capture(cap2));
replay(obj);
obj.doSomethingToCauseMethodCalls();
verify(obj);
Problem:
================
The object returned from cap1.getValue() == cap2.getValue(). Or - to be more precise - no matter which capture object you use the only value returned from getValue() will be the last captured value.
Probably some static state thing but didn't seem like this is what you guys intended.