Object returnValue3 = new Object();
Closure refreshFunction = (Closure) EasyMock.createMock(Closure.class);
EasyMock.expect(refreshFunction.call(null)).andReturn(returnValue1);
EasyMock.expect(refreshFunction.call(null)).andReturn(returnValue2);
EasyMock.expect(refreshFunction.call(null)).andReturn(returnValue3);
EasyMock.replay(refreshFunction);
RefreshableValueHolder valueHolder = new RefreshableValueHolder(refreshFunction, true, true);
assertSame(returnValue1, valueHolder.getValue());
assertSame(returnValue2, valueHolder.getValue());