### Question:
FacebookAdapter implements ApiAdapter<Facebook> { public UserProfile fetchUserProfile(Facebook facebook) { User profile = facebook.userOperations().getUserProfile(); return new UserProfileBuilder().setId(profile.getId()).setName(profile.getName()).setFirstName(profile.getFirstName()).setLastName(profile.getLastName()). setEmail(profile.getEmail()).build(); }  boolean test(Facebook facebook); void setConnectionValues(Facebook facebook, ConnectionValues values); UserProfile fetchUserProfile(Facebook facebook); void updateStatus(Facebook facebook, String message);  }### Answer:
@Test public void fetchProfile() { UserOperations userOperations = Mockito.mock(UserOperations.class); Mockito.when(facebook.userOperations()).thenReturn(userOperations); Mockito.when(facebook.getBaseGraphApiUrl()).thenReturn(GRAPH_API_URL); Mockito.when(userOperations.getUserProfile()).thenReturn(new User("12345678", "Craig Walls", "Craig", "Walls", null, null)); UserProfile profile = apiAdapter.fetchUserProfile(facebook); assertEquals("12345678", profile.getId()); assertEquals("Craig Walls", profile.getName()); assertEquals("Craig", profile.getFirstName()); assertEquals("Walls", profile.getLastName()); assertNull(profile.getEmail()); assertNull(profile.getUsername()); }