class DefaultSearchDepthPolicy extends AbstractPolicy implements SearchDepthPolicy {

    @Override
    public List<Search> inputForSubSearches(SearchResult searchResult)
    {
        List<Search> subSearchable = new ArrayList<>();
        int currentLevel = searchResult.getCurrentLevel();
        for (Search search : searchResult.getSearches())
        {
            if (search.getLevel() == currentLevel && search.isRejected() && nextLevelEnabled(search.getRequest()))
            {
                subSearchable.add(search);
            }
        }

        return subSearchable;
    }

}