public Boolean isFriend(String accessToken, String facebookId) {
return getFriend(accessToken, facebookId) != null;
}
public User getFriend(String accessToken, String facebookId) throws FacebookOAuthException {
FacebookClient fb = createFacebookClient(accessToken);
List<User> users = fb.executeFqlQuery(FRIEND_FQL.replaceAll(FRIEND_FQL_REPLACEMENT, facebookId), User.class);
try {
return users.iterator().next();
} catch (NoSuchElementException e) {
return null;
}