@Test
public void shouldProperlyMapPermissionEntityCollectionIntoPermissionCollection()
    throws Exception {

  PermissionEntity cameraPermissionEntity = new PermissionEntity.Builder()
      .permission("CAMERA")
      .rationaleTitle("Permission Request")
      .rationaleMessage("You should allow this permission")
      .deniedMessage("You must allow this permission in order for this feature to work")
      .build();
  PermissionEntity contactsPermissionEntity = new PermissionEntity.Builder()
      .permission("CONTACTS")
      .rationaleTitle("Permission Request")
      .rationaleMessage("You should allow this permission")
      .deniedMessage("You must allow this permission")
      .build();
  ArrayList<PermissionEntity> permissionEntities = new ArrayList<>();
  permissionEntities.add(cameraPermissionEntity);
  permissionEntities.add(contactsPermissionEntity);
  Collection<Permission> permissions = permissionEntityDataMapper.transform(permissionEntities);
  assertThat(permissions, notNullValue());
  assertThat(permissions.size(), is(2));
  Permission permission1 = (Permission) permissions.toArray()[0];
  assertThat(permission1, notNullValue());
  assertThat(permission1.permission(), is("CAMERA"));
  Permission permission2 = (Permission) permissions.toArray()[1];
  assertThat(permission2, notNullValue());
  assertThat(permission2.permission(), is("CONTACTS"));
}