### Question:
UserEntityJsonMapper { public List<UserEntity> transformUserEntityCollection(String userListJsonResponse) throws JsonSyntaxException { final Type listOfUserEntityType = new TypeToken<List<UserEntity>>() {}.getType(); return this.gson.fromJson(userListJsonResponse, listOfUserEntityType); } @Inject  UserEntityJsonMapper(); UserEntity transformUserEntity(String userJsonResponse); List<UserEntity> transformUserEntityCollection(String userListJsonResponse);  }### Answer:
@Test public void testTransformUserEntityCollectionHappyCase() { Collection<UserEntity> userEntityCollection = userEntityJsonMapper.transformUserEntityCollection( JSON_RESPONSE_USER_COLLECTION); assertThat(((UserEntity) userEntityCollection.toArray()[0]).getUserId(), is(1)); assertThat(((UserEntity) userEntityCollection.toArray()[1]).getUserId(), is(12)); assertThat(userEntityCollection.size(), is(2)); }
@Test public void testTransformUserEntityCollectionNotValidResponse() { expectedException.expect(JsonSyntaxException.class); userEntityJsonMapper.transformUserEntityCollection("Tony Stark"); }