code: public SearchResult search(final S goalState){
          return search(new Predicate<N>() {
              @Override
              public boolean apply(N n) {
                  if (goalState != null) {
                      return n.state().equals(goalState);
                  }
                  return false;
              }
          });
      }
docs: Run the algorithm until the goal is found or no more states are
  available.
  @return SearchResult with the information of the search