public interface ExampleInterface { public void doSomething(); } ExampleInterface mockInterface = EasyMock.createMock(ExampleInterface.class);
public class ExampleClass { public void doSomething() { // Method implementation } } ExampleClass mockClass = EasyMock.createMock(ExampleClass.class);In this example, we create a mock object for the ExampleClass class using the createMock() method. Package Library: org.easymock