@Test
public void shouldProperlyMapPermissionCollectionIntoPermissionEntityCollection()
    throws Exception {

  Permission cameraPermission = Permission.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();
  Permission contactsPermission = Permission.builder()
      .permission("CONTACTS")
      .rationaleTitle("Permission Request")
      .rationaleMessage("You should allow this permission")
      .deniedMessage("You must allow this permission")
      .build();
  ArrayList<Permission> permissions = new ArrayList<>();
  permissions.add(cameraPermission);
  permissions.add(contactsPermission);
  Collection<PermissionEntity> permissionEntities =
      permissionEntityDataMapper.transformInverse(permissions);
  assertThat(permissionEntities, notNullValue());
  assertThat(permissionEntities.size(), is(2));
  PermissionEntity permissionEntity1 = (PermissionEntity) permissionEntities.toArray()[0];
  assertThat(permissionEntity1, notNullValue());
  assertThat(permissionEntity1.getPermission(), is("CAMERA"));
  PermissionEntity permissionEntity2 = (PermissionEntity) permissionEntities.toArray()[1];
  assertThat(permissionEntity2.getPermission(), is("CONTACTS"));
}