What I want to do is to find the friends that are already users of the samme application. Is that possible ?

The use case is that X of my friends are already users of the app and I want to easily know that so I can interact with them in the app !

Facebook fb = usersConnectionRepository.createConnectionReposito ry(searcher.getId()).getPrimaryConnection(Facebook .class).getApi();
List<Reference> friends = fb.friendOperations().getFriends();
for (Reference friend : friends) {
if (friendIsUser(friend.getId()) {
//do something with him/her
}
}

how to code friendIsUser ?

that is, is there already a method that does
"select userId from " + tablePrefix + "UserConnection where providerId = ? and providerUserId = ?"