@Test
public void shouldProperlyMapPermissionCollectionIntoPermissionModelCollection()
    throws Exception {

  Permission permission1 = Permission.builder()
      .permission("CAMERA")
      .rationaleTitle("Permission Request")
      .rationaleMessage("You should allow it")
      .deniedMessage("Allow it!")
      .build();
  Permission permission2 = Permission.builder()
      .permission("CONTACTS")
      .rationaleTitle("Permission Request")
      .rationaleMessage("You should allow it, please")
      .deniedMessage("ALLOW IT!!")
      .build();
  ArrayList<Permission> permissions = new ArrayList<>();
  permissions.add(permission1);
  permissions.add(permission2);
  Collection<PermissionModel> permissionModels = permissionModelDataMapper.transform(permissions);
  assertThat(permissionModels, notNullValue());
  assertThat(permissionModels.size(), is(2));
  PermissionModel permissionModel1 = (PermissionModel) permissionModels.toArray()[0];
  assertThat(permissionModel1, notNullValue());
  assertThat(permissionModel1, instanceOf(PermissionModel.class));
  assertThat(permissionModel1.permission(), notNullValue());
  assertThat(permissionModel1.permission(), is("CAMERA"));
  PermissionModel permissionModel2 = (PermissionModel) permissionModels.toArray()[1];
  assertThat(permissionModel2, notNullValue());
  assertThat(permissionModel2, instanceOf(PermissionModel.class));
  assertThat(permissionModel2.permission(), notNullValue());
  assertThat(permissionModel2.permission(), is("CONTACTS"));
}