cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudbus/cloudsim/schedulers/cloudlet/CloudletSchedulerAbstract.java
private Cloudlet changeStatusOfCloudletIntoList(
        List<CloudletExecutionInfo> cloudletList, int cloudletId,
        Consumer<CloudletExecutionInfo> cloudletStatusUpdaterConsumer)
    {
        final Function<CloudletExecutionInfo, Cloudlet> removeCloudletFromListAndUpdateItsStatus = c -> {
            cloudletList.remove(c);
            cloudletStatusUpdaterConsumer.accept(c);
            return c.getCloudlet();
        };

        return cloudletList.stream()
            .filter(c -> c.getCloudlet().getId() == cloudletId)
            .findFirst()
            .map(removeCloudletFromListAndUpdateItsStatus)
            .orElse(Cloudlet.NULL);
    }
/**
     * Search for a cloudlet into a given list in order to change its status and
     * remove it from that list.
     *
     * @param cloudletList                  the list where to search the cloudlet
     * @param cloudletId                    the id of the cloudlet to have its status changed
     * @param cloudletStatusUpdaterConsumer the {@link Consumer} that will apply
     *                                      the change in the status of the found cloudlet
     * @return the changed cloudlet or {@link Cloudlet#NULL} if not found in the
     * given list
     */
Search for a cloudlet into a given list in order to change its status and
remove it from that list.

@param cloudletList                  the list where to search the cloudlet
@param cloudletId                    the id of the cloudlet to have its status changed
@param cloudletStatusUpdaterConsumer the  Consumer that will apply
the change in the status of the found cloudlet
@return the changed cloudlet or  Cloudlet#NULL if not found in the
given list
Search for a cloudlet into a given list in order to change its status and remove it from that list . @param cloudletList the list where to search the cloudlet @param cloudletId the id of the cloudlet to have its status changed @param cloudletStatusUpdaterConsumer the Consumer that will apply the change in the status of the found cloudlet @return the changed cloudlet or Cloudlet#NULL if not found in the given list
private Cloudlet changeStatusOfCloudletIntoList(
        List<CloudletExecutionInfo> cloudletList, int cloudletId,
        Consumer<CloudletExecutionInfo> cloudletStatusUpdaterConsumer)
    {
        final Function<CloudletExecutionInfo, Cloudlet> removeCloudletFromListAndUpdateItsStatus = c -> {
            cloudletList.remove(c);
            cloudletStatusUpdaterConsumer.accept(c);
            return c.getCloudlet();
        };
        return cloudletList.stream()
            .filter(c -> c.getCloudlet().getId() == cloudletId)
            .findFirst()
            .map(removeCloudletFromListAndUpdateItsStatus)
            .orElse(Cloudlet.NULL);
    }
private Cloudlet changeStatusOfCloudletIntoList ( List < CloudletExecutionInfo > cloudletList , int cloudletId , Consumer < CloudletExecutionInfo > cloudletStatusUpdaterConsumer ) { final Function < CloudletExecutionInfo , Cloudlet > removeCloudletFromListAndUpdateItsStatus = c -> { cloudletList . remove ( c ) ; cloudletStatusUpdaterConsumer . accept ( c ) ; return c . getCloudlet ( ) ; } ; return cloudletList . stream ( ) . filter ( c -> c . getCloudlet ( ) . getId ( ) == cloudletId ) . findFirst ( ) . map ( removeCloudletFromListAndUpdateItsStatus ) . orElse ( Cloudlet . NULL ) ; }
Search for a cloudlet into a given list in order to change its status and
 remove it from that list.
Search for a cloudlet into a given list in order to change its status and remove it from that list .