lojix/search/src/main/com/thesett/aima/search/util/Searches.java
public static <T> Collection<T> bagOf(SearchMethod<T> method)
    {
        Collection<T> result = new ArrayList<T>();
        findAll(result, method);

        return result;
    }
public static <T> Collection<T> bagOf(SearchMethod<T> method)
    {
        Collection<T> result = new ArrayList<T>();
        findAll(result, method);

        return result;
    }
public static < T > Collection < T > bagOf ( SearchMethod < T > method ) { Collection < T > result = new ArrayList < T > ( ) ; findAll ( result , method ) ; return result ; }
Finds a bag of all goals of a search.

@param  <T>    The traversable state type of the search.
@param  method The search method to find all goals of.

@return A bag of all goals found.
Finds a bag of all goals of a search .