verify(myClassMock1);
}
@Test
public void testMultipleNew() throws Exception {
ExpectNewDemo tested = new ExpectNewDemo();
MyClass myClassMock1 = createMock(MyClass.class);
MyClass myClassMock2 = createMock(MyClass.class);
expectNew(MyClass.class).andReturn(myClassMock1);
expectNew(MyClass.class).andReturn(myClassMock2);
expect(myClassMock1.getMessage()).andReturn("Hello ");
expect(myClassMock2.getMessage()).andReturn("World");
replay(myClassMock1, myClassMock2, MyClass.class);
final String actual = tested.multipleNew();
verify(myClassMock1, myClassMock2, MyClass.class);
assertEquals("Hello World", actual);
}