### Question:
EntityPermissionEvaluatorFactory { @SuppressWarnings({"rawtypes", "unchecked"}) public PersistentObjectPermissionEvaluator<E> getEntityPermissionEvaluator( final Class<E> entityClass) { if (PermissionCollection.class.isAssignableFrom(entityClass)) { return new PermissionCollectionPermissionEvaluator(); } if (User.class.isAssignableFrom(entityClass)) { return new UserPermissionEvaluator(); } if (UserGroup.class.isAssignableFrom(entityClass)) { return new UserGroupPermissionEvaluator(); } if (Extent.class.isAssignableFrom(entityClass) || InterceptorRule.class.isAssignableFrom(entityClass) || LayerAppearance.class.isAssignableFrom(entityClass) || LayerDataSource.class.isAssignableFrom(entityClass) || Layout.class.isAssignableFrom(entityClass) || MapConfig.class.isAssignableFrom(entityClass) || MapControl.class.isAssignableFrom(entityClass) || Module.class.isAssignableFrom(entityClass) || Role.class.isAssignableFrom(entityClass) || TileGrid.class.isAssignableFrom(entityClass) || Token.class.isAssignableFrom(entityClass)) { return new AlwaysAllowReadPermissionEvaluator(); } return new PersistentObjectPermissionEvaluator<E>(entityClass); }  @SuppressWarnings({"rawtypes", "unchecked"}) PersistentObjectPermissionEvaluator<E> getEntityPermissionEvaluator(
        final Class<E> entityClass);  }### Answer:
@SuppressWarnings({"rawtypes", "unchecked"}) @Test public void getEntityPermissionEvaluator_shouldReturnUserEvaluatorForUserClass() { Class<User> userClass = User.class; PersistentObjectPermissionEvaluator entityPermissionEvaluator = entityPermissionEvaluatorFactory .getEntityPermissionEvaluator(userClass); assertThat(entityPermissionEvaluator, instanceOf(UserPermissionEvaluator.class)); }
@SuppressWarnings({"rawtypes", "unchecked"}) @Test public void getEntityPermissionEvaluator_shouldReturnDefaultEvaluatorForPersistentObjects() { Class<PersistentObject> persistentObjectClass = PersistentObject.class; PersistentObjectPermissionEvaluator entityPermissionEvaluator = entityPermissionEvaluatorFactory .getEntityPermissionEvaluator(persistentObjectClass); assertThat(entityPermissionEvaluator, instanceOf(PersistentObjectPermissionEvaluator.class)); }