public Iterable < GitHub > findGithubConfig ( Predicate < GitHubServerConfig > match ) { Function < GitHubServerConfig , GitHub > loginFunction = loginToGithub ( ) ; if ( Objects . isNull ( loginFunction ) ) { return Collections . emptyList ( ) ; } // try all the credentials since we don't know which one would work return from ( getConfigs ( ) ) . filter ( match ) . transform ( loginFunction ) . filter ( Predicates . notNull ( ) ) ; }
Filters all stored configs against given predicate then logs in as the given user and returns the non null connection objects