FacebookUtilsImpl implements FacebookUtils { @Override public List<HintPerson> findFriends(String accessToken) { try { URI friendsPageUri = new URIBuilder("https: .addParameter("access_token", accessToken) .addParameter("limit", "250") .build(); Future<List<JsonNode>> pagesFuture = friendListDownloader.fetchFriendsPages(friendsPageUri); List<JsonNode> pages = pagesFuture.get(); List<UserRef> userList = userListParser.parseNodes(pages).get(); log.info("Parsed {} users", userList.size()); List<HintPerson> hintPeople = Lists.transform(userList, new Function<UserRef, HintPerson>() { @Override public HintPerson apply(UserRef input) { HintPerson hintPerson = new HintPerson(null, null, input.getName(), null, input.getId() + "@facebook.com", input.getId()); return hintPerson; } }); return hintPeople; } catch (Exception e) { log.error("Cannot find friends", e); throw new RuntimeException("Cannot find friends", e); } } @Inject  FacebookUtilsImpl(FriendListDownloader friendListDownloader,
			UserListParser userListParser); @Override List<HintPerson> findFriends(String accessToken); @Override List<HintPerson> findFriendsCached(String accessToken); static String refreshPhotoFromFacebook(final Long facebookId, final String personName,
			ImageRepository imageRepo);  }
@Test public void findFriends() { final List<HintPerson> hints = facebookUtils.findFriends("---"); assertNotNull(hints); log.info("Got {} friends", hints.size()); assertThat(hints.size(), greaterThanOrEqualTo(800)); }