cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/test/java/org/cloudbus/cloudsim/mocks/CloudSimMocker.java
public static CloudSim createMock(final Consumer<CloudSimMocker> consumer) {
        final CloudSimMocker mocker = new CloudSimMocker();
        consumer.accept(mocker);
        EasyMock.expect(mocker.mock.isRunning()).andReturn(true).anyTimes();
        CloudSimMocker.replay(mocker.mock);
        return mocker.mock;
    }
/**
     * Creates a CloudSim mock object. It requires a {@link Consumer} object as
     * parameter (that can be a lambda expression) where the developer defines
     * what methods of the Mocker class will be called. Each CloudSimMocker's
     * method call defines a method in the mocked CloudSim class that is
     * expected to be called.
     * <p>
     * An usage example can be as follows:
     * <br>
     * {@code CloudSimMocker.createMock(mocker -> mocker.clock(10).getEntityName(1));}
     * </p>
     * This example will mock the static methods clock and getEntityName
     * from CloudSim class, making it return 10 and 1, respectively.
     *
     * <p>
     * If you a mocked method to return 2 different values in different calls,
     * use a code like that:
     * <br>
     * {@code CloudSimMocker.createMock(mocker -> mocker.clock(10).clock(11));}
     * </p>
     * This example will make the mocked CloudSim.clock() method to return 10
     * for the first time it is called inside a unit test and 11 for the second
     * time.
     *
     * <p>
     * Realize that the provided examples uses lambda expression as a parameter
     * to the createMock method, defining which method calls are expected in the
     * mocked CloudSim class.</p>
     *
     * @param consumer a {@link Consumer} that will receive the CloudSimMocker instance
     *                 to allow the developer to call some of its methods to mock
     *                 methods from CloudSim class
     * @return the created CloudSim mock object
     */
Creates a CloudSim mock object. It requires a  Consumer object as
parameter (that can be a lambda expression) where the developer defines
what methods of the Mocker class will be called. Each CloudSimMocker's
method call defines a method in the mocked CloudSim class that is
expected to be called.

An usage example can be as follows:

CloudSimMocker.createMock(mocker -> mocker.clock(10).getEntityName(1));

This example will mock the static methods clock and getEntityName
from CloudSim class, making it return 10 and 1, respectively.


If you a mocked method to return 2 different values in different calls,
use a code like that:

CloudSimMocker.createMock(mocker -> mocker.clock(10).clock(11));

This example will make the mocked CloudSim.clock() method to return 10
for the first time it is called inside a unit test and 11 for the second
time.


Realize that the provided examples uses lambda expression as a parameter
to the createMock method, defining which method calls are expected in the
mocked CloudSim class.

@param consumer a  Consumer that will receive the CloudSimMocker instance
to allow the developer to call some of its methods to mock
methods from CloudSim class
@return the created CloudSim mock object
Creates a CloudSim mock object . It requires a Consumer object as parameter ( that can be a lambda expression ) where the developer defines what methods of the Mocker class will be called . Each CloudSimMocker ' s method call defines a method in the mocked CloudSim class that is expected to be called . An usage example can be as follows : CloudSimMocker . createMock ( mocker - > mocker . clock ( 10 ) . getEntityName ( 1 )) ; This example will mock the static methods clock and getEntityName from CloudSim class making it return 10 and 1 respectively . If you a mocked method to return 2 different values in different calls use a code like that : CloudSimMocker . createMock ( mocker - > mocker . clock ( 10 ) . clock ( 11 )) ; This example will make the mocked CloudSim . clock () method to return 10 for the first time it is called inside a unit test and 11 for the second time . Realize that the provided examples uses lambda expression as a parameter to the createMock method defining which method calls are expected in the mocked CloudSim class . @param consumer a Consumer that will receive the CloudSimMocker instance to allow the developer to call some of its methods to mock methods from CloudSim class @return the created CloudSim mock object
public static CloudSim createMock(final Consumer<CloudSimMocker> consumer) {
        final CloudSimMocker mocker = new CloudSimMocker();
        consumer.accept(mocker);
        EasyMock.expect(mocker.mock.isRunning()).andReturn(true).anyTimes();
        CloudSimMocker.replay(mocker.mock);
        return mocker.mock;
    }
public static CloudSim createMock ( final Consumer < CloudSimMocker > consumer ) { final CloudSimMocker mocker = new CloudSimMocker ( ) ; consumer . accept ( mocker ) ; EasyMock . expect ( mocker . mock . isRunning ( ) ) . andReturn ( true ) . anyTimes ( ) ; CloudSimMocker . replay ( mocker . mock ) ; return mocker . mock ; }
Creates a CloudSim mock object.
Creates a CloudSim mock object .