cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudbus/cloudsim/schedulers/cloudlet/CloudletSchedulerAbstract.java
protected Optional<CloudletExecutionInfo> findCloudletInAllLists(final double cloudletId) {
        //Concatenate all lists into a strem
        final Stream<List<CloudletExecutionInfo>> streamOfAllLists
            = Stream.of(cloudletExecList, cloudletPausedList, cloudletWaitingList,
            cloudletFinishedList, cloudletFailedList);
        //Gets all elements in each list and makes them a single full list,
        //returning the first Cloudlet with the given id
        return streamOfAllLists
            .flatMap(List::stream)
            .filter(c -> c.getCloudletId() == cloudletId)
            .findFirst();
    }
/**
     * Search for a Cloudlet into all Cloudlet lists.
     *
     * @param cloudletId the id of the Cloudlet to search for
     * @return an {@link Optional} value that is able to indicate if the
     * Cloudlet was found or not
     */
Search for a Cloudlet into all Cloudlet lists.
@param cloudletId the id of the Cloudlet to search for
@return an  Optional value that is able to indicate if the
Cloudlet was found or not
Search for a Cloudlet into all Cloudlet lists . @param cloudletId the id of the Cloudlet to search for @return an Optional value that is able to indicate if the Cloudlet was found or not
protected Optional<CloudletExecutionInfo> findCloudletInAllLists(final double cloudletId) {
        final Stream<List<CloudletExecutionInfo>> streamOfAllLists
            = Stream.of(cloudletExecList, cloudletPausedList, cloudletWaitingList,
            cloudletFinishedList, cloudletFailedList);
        return streamOfAllLists
            .flatMap(List::stream)
            .filter(c -> c.getCloudletId() == cloudletId)
            .findFirst();
    }
protected Optional < CloudletExecutionInfo > findCloudletInAllLists ( final double cloudletId ) { final Stream < List < CloudletExecutionInfo > > streamOfAllLists = Stream . of ( cloudletExecList , cloudletPausedList , cloudletWaitingList , cloudletFinishedList , cloudletFailedList ) ; return streamOfAllLists . flatMap ( List :: stream ) . filter ( c -> c . getCloudletId ( ) == cloudletId ) . findFirst ( ) ; }
Search for a Cloudlet into all Cloudlet lists.
Search for a Cloudlet into all Cloudlet lists .
//Concatenate all lists into a strem //Gets all elements in each list and makes them a single full list, //returning the first Cloudlet with the given id