lojix/search/src/main/com/thesett/aima/search/util/Searches.java
private static <T> void findAll(Collection<T> result, SearchMethod<T> method)
    {
        for (Iterator<T> i = allSolutions(method); i.hasNext();)
        {
            T nextSoltn = i.next();

            result.add(nextSoltn);
        }
    }
private static <T> void findAll(Collection<T> result, SearchMethod<T> method)
    {
        for (Iterator<T> i = allSolutions(method); i.hasNext();)
        {
            T nextSoltn = i.next();

            result.add(nextSoltn);
        }
    }
private static < T > void findAll ( Collection < T > result , SearchMethod < T > method ) { for ( Iterator < T > i = allSolutions ( method ) ; i . hasNext ( ) ; ) { T nextSoltn = i . next ( ) ; result . add ( nextSoltn ) ; } }
Finals all solutions to a search and inserts them into the specified collection.

@param <T>    The traversable state type of the search.
@param result The collection to build up the results in.
@param method The search to run.
Finals all solutions to a search and inserts them into the specified collection .