code: public static Optional<NameID> getNameId(Response response, Predicate<NameID> filter) {
          return response.getAssertions().stream()
                         .map(s -> s.getSubject().getNameID())
                         .filter(filter)
                         .findFirst();
      }
docs: Returns a {@link NameID} which is matched to the specified {@code filter} from the {@link Response}.