### Question:
FriendApi { @POST @Path("/friends") @Consumes("application/json") @Produces("application/json") public Friend addFriend(@PathParam("id") LongParam id, Friend body) { return friendService.addFriend(id.get(), body); } @Inject  FriendApi(FriendApiService friendService, ParticipantApi.ParticipantApiService participantService); @GET @Produces("application/json") /** * retrieve an individual participant * fetch a participant by id * @param id uniquely identifies the participant (required) * @return Participant */ Participant getParticipant(@PathParam("id") LongParam id); @POST @Path("/friends") @Consumes("application/json") @Produces("application/json") /** * create a new friendship * friends are those participants who receive news * @param id uniquely identifies the participant (required) * @param body friendship to be created (required) * @return Friend */ Friend addFriend(@PathParam("id") LongParam id,  Friend body); @GET @Path("/friends") @Produces("application/json") /** * retrieve the list of friends for an individual participant * fetch participant friends * @param id uniquely identifies the participant (required) * @return List<Friend> */ List<Friend> getFriend(@PathParam("id") LongParam id);  }### Answer:
@Test public void addFriendTest() { assertTrue(String.format("expected id to be %d but it was %d instead", TEST_ID, friendApi.addFriend(TEST_FROM, friend).getId()), friendApi.addFriend(TEST_FROM, friend).getId() == TEST_ID); }