syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [2/2] syncope git commit: Upgrading Commons Collections
Date Sat, 28 Nov 2015 09:49:01 GMT
Upgrading Commons Collections


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/2030cd27
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/2030cd27
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/2030cd27

Branch: refs/heads/master
Commit: 2030cd27b072c12ca640ea83b0848e5463f46710
Parents: 073e29a
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Sat Nov 28 10:48:28 2015 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Sat Nov 28 10:48:28 2015 +0100

----------------------------------------------------------------------
 .../client/console/panels/ConnectorModal.java   | 13 +++---
 .../client/console/panels/ResourceModal.java    |  4 +-
 .../markup/html/form/SelectChoiceRenderer.java  |  4 +-
 .../syncope/common/lib/AnyOperations.java       |  3 +-
 .../lib/SyncopeClientCompositeException.java    |  4 +-
 .../syncope/common/lib/patch/GroupPatch.java    |  4 +-
 .../syncope/common/lib/search/SpecialAttr.java  |  7 +--
 .../apache/syncope/common/lib/to/GroupTO.java   |  4 +-
 .../apache/syncope/common/lib/to/MappingTO.java |  4 +-
 .../syncope/common/lib/to/ResourceTO.java       |  4 +-
 .../syncope/core/logic/AbstractAnyLogic.java    |  5 ++-
 .../apache/syncope/core/logic/GroupLogic.java   |  3 +-
 .../core/misc/security/AuthDataAccessor.java    |  3 +-
 .../misc/security/MustChangePasswordFilter.java |  4 +-
 .../misc/security/SyncopeGrantedAuthority.java  |  4 +-
 .../validation/InvalidEntityException.java      |  4 +-
 .../persistence/jpa/dao/JPAAnyObjectDAO.java    |  3 +-
 .../persistence/jpa/dao/JPAConnInstanceDAO.java | 15 +++----
 .../core/persistence/jpa/dao/JPAGroupDAO.java   |  4 +-
 .../core/persistence/jpa/dao/JPARealmDAO.java   |  4 +-
 .../core/persistence/jpa/dao/JPATaskDAO.java    | 18 ++++----
 .../core/persistence/jpa/dao/JPAUserDAO.java    |  3 +-
 .../persistence/jpa/entity/AbstractAny.java     |  5 ++-
 .../persistence/jpa/entity/JPANotification.java |  4 +-
 .../core/persistence/jpa/entity/JPARealm.java   |  8 ++--
 .../jpa/entity/anyobject/JPAAnyObject.java      |  5 ++-
 .../persistence/jpa/entity/conf/JPAConf.java    |  4 +-
 .../persistence/jpa/entity/group/JPAGroup.java  |  4 +-
 .../entity/resource/JPAExternalResource.java    |  5 ++-
 .../jpa/entity/resource/JPAMapping.java         |  4 +-
 .../jpa/entity/task/JPAPushTask.java            |  4 +-
 .../jpa/entity/task/JPASyncTask.java            |  4 +-
 .../persistence/jpa/entity/user/JPAUser.java    |  5 ++-
 .../entity/ExternalResourceValidator.java       |  6 +--
 .../persistence/jpa/inner/AnySearchTest.java    | 18 ++++----
 .../persistence/jpa/inner/ResourceTest.java     |  4 +-
 .../java/data/ConnInstanceDataBinderImpl.java   |  4 +-
 .../java/data/UserDataBinderImpl.java           |  3 +-
 .../DBPasswordPropagationActions.java           |  4 +-
 .../propagation/DefaultPropagationReporter.java |  6 +--
 .../LDAPPasswordPropagationActions.java         |  4 +-
 .../java/sync/DBPasswordSyncActions.java        |  4 +-
 .../java/sync/LDAPMembershipSyncActions.java    |  4 +-
 .../core/workflow/activiti/ActivitiUtils.java   |  4 +-
 .../fit/core/reference/TestSyncActions.java     |  4 +-
 .../fit/core/reference/AbstractTaskITCase.java  |  4 +-
 .../core/reference/AuthenticationITCase.java    |  7 +--
 .../syncope/fit/core/reference/CLIITCase.java   | 47 ++++++++++----------
 .../fit/core/reference/CamelRouteITCase.java    |  4 +-
 .../syncope/fit/core/reference/GroupITCase.java |  4 +-
 .../fit/core/reference/PlainSchemaITCase.java   |  6 +--
 .../syncope/fit/core/reference/RealmITCase.java |  6 +--
 .../fit/core/reference/SearchITCase.java        | 27 +++++------
 .../fit/core/reference/SyncTaskITCase.java      |  6 +--
 pom.xml                                         |  2 +-
 55 files changed, 183 insertions(+), 168 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
index ecbd96a..b7dca18 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
@@ -23,6 +23,7 @@ import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.client.console.commons.Constants;
 import org.apache.syncope.client.console.pages.AbstractBasePage;
@@ -61,11 +62,11 @@ public class ConnectorModal extends AbstractResourceModal {
         this.bundles = CollectionUtils.select(connectorRestClient.getAllBundles(),
                 new Predicate<ConnBundleTO>() {
 
-                    @Override
-                    public boolean evaluate(final ConnBundleTO object) {
-                        return object.getLocation().equals(model.getObject().getLocation());
-                    }
-                }, new ArrayList<ConnBundleTO>());
+            @Override
+            public boolean evaluate(final ConnBundleTO object) {
+                return object.getLocation().equals(model.getObject().getLocation());
+            }
+        }, new ArrayList<ConnBundleTO>());
 
         //--------------------------------
         // Connector details panel
@@ -175,7 +176,7 @@ public class ConnectorModal extends AbstractResourceModal {
     }
 
     protected static ConnBundleTO getBundle(final ConnInstanceTO connInstanceTO, final List<ConnBundleTO> bundles) {
-        return CollectionUtils.find(bundles, new Predicate<ConnBundleTO>() {
+        return IterableUtils.find(bundles, new Predicate<ConnBundleTO>() {
 
             @Override
             public boolean evaluate(final ConnBundleTO bundle) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceModal.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceModal.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceModal.java
index 401f90f..5f06c14 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceModal.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceModal.java
@@ -21,7 +21,7 @@ package org.apache.syncope.client.console.panels;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.lang3.SerializationUtils;
 import org.apache.syncope.client.console.commons.Constants;
@@ -220,7 +220,7 @@ public class ResourceModal extends AbstractResourceModal {
                 if (provision.getMapping() == null || provision.getMapping().getItems().isEmpty()) {
                     resourceTO.getProvisions().remove(provision);
                 } else {
-                    int uConnObjectKeyCount = CollectionUtils.countMatches(
+                    long uConnObjectKeyCount = IterableUtils.countMatches(
                             provision.getMapping().getItems(), new Predicate<MappingItemTO>() {
 
                         @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/SelectChoiceRenderer.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/SelectChoiceRenderer.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/SelectChoiceRenderer.java
index 250ce19..d4a7644 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/SelectChoiceRenderer.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/SelectChoiceRenderer.java
@@ -19,7 +19,7 @@
 package org.apache.syncope.client.console.wicket.markup.html.form;
 
 import java.util.List;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.wicket.markup.html.form.IChoiceRenderer;
 import org.apache.wicket.model.IModel;
@@ -44,7 +44,7 @@ public class SelectChoiceRenderer<T> implements IChoiceRenderer<T> {
 
     @Override
     public T getObject(final String id, final IModel<? extends List<? extends T>> choices) {
-        return CollectionUtils.find(choices.getObject(), new Predicate<T>() {
+        return IterableUtils.find(choices.getObject(), new Predicate<T>() {
 
             @Override
             public boolean evaluate(final T object) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/common/lib/src/main/java/org/apache/syncope/common/lib/AnyOperations.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/AnyOperations.java b/common/lib/src/main/java/org/apache/syncope/common/lib/AnyOperations.java
index 1a36c4f..f9d4372 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/AnyOperations.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/AnyOperations.java
@@ -24,6 +24,7 @@ import java.util.Map;
 import java.util.Set;
 import org.apache.commons.collections4.Closure;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.lang3.SerializationUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.lib.patch.AnyObjectPatch;
@@ -106,7 +107,7 @@ public final class AnyOperations {
         result.getPlainAttrs().clear();
 
         if (!incremental) {
-            CollectionUtils.forAllDo(CollectionUtils.subtract(originalAttrs.keySet(), updatedAttrs.keySet()),
+            IterableUtils.forEach(CollectionUtils.subtract(originalAttrs.keySet(), updatedAttrs.keySet()),
                     new Closure<String>() {
 
                 @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/common/lib/src/main/java/org/apache/syncope/common/lib/SyncopeClientCompositeException.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/SyncopeClientCompositeException.java b/common/lib/src/main/java/org/apache/syncope/common/lib/SyncopeClientCompositeException.java
index ebdc5ae..b338df8 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/SyncopeClientCompositeException.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/SyncopeClientCompositeException.java
@@ -21,7 +21,7 @@ package org.apache.syncope.common.lib;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.ClientExceptionType;
 
@@ -68,7 +68,7 @@ public class SyncopeClientCompositeException extends SyncopeClientException {
                     + ClientExceptionType.class.getName() + " set");
         }
 
-        SyncopeClientException alreadyAdded = CollectionUtils.find(exceptions, new Predicate<SyncopeClientException>() {
+        SyncopeClientException alreadyAdded = IterableUtils.find(exceptions, new Predicate<SyncopeClientException>() {
 
             @Override
             public boolean evaluate(final SyncopeClientException ex) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java
index 209b33e..250194a 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java
@@ -26,7 +26,7 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.to.TypeExtensionTO;
 
@@ -90,7 +90,7 @@ public class GroupPatch extends AnyPatch {
 
     @JsonIgnore
     public TypeExtensionTO getTypeExtension(final String anyType) {
-        return CollectionUtils.find(typeExtensions, new Predicate<TypeExtensionTO>() {
+        return IterableUtils.find(typeExtensions, new Predicate<TypeExtensionTO>() {
 
             @Override
             public boolean evaluate(final TypeExtensionTO typeExtension) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/common/lib/src/main/java/org/apache/syncope/common/lib/search/SpecialAttr.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/search/SpecialAttr.java b/common/lib/src/main/java/org/apache/syncope/common/lib/search/SpecialAttr.java
index 1b1f484..c8b917c 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/search/SpecialAttr.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/search/SpecialAttr.java
@@ -19,14 +19,15 @@
 package org.apache.syncope.common.lib.search;
 
 import java.util.Arrays;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 
 public enum SpecialAttr {
 
     /**
      * Applies to users, groups and any objects.
-     *//**
+     */
+    /**
      * Applies to users, groups and any objects.
      */
     NULL("$null"),
@@ -71,7 +72,7 @@ public enum SpecialAttr {
     }
 
     public static SpecialAttr fromString(final String value) {
-        return CollectionUtils.find(Arrays.asList(values()), new Predicate<SpecialAttr>() {
+        return IterableUtils.find(Arrays.asList(values()), new Predicate<SpecialAttr>() {
 
             @Override
             public boolean evaluate(final SpecialAttr specialAttr) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java
index c304b9e..bedd2f3 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java
@@ -26,7 +26,7 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 
@@ -100,7 +100,7 @@ public class GroupTO extends AnyTO {
 
     @JsonIgnore
     public TypeExtensionTO getTypeExtension(final String anyType) {
-        return CollectionUtils.find(typeExtensions, new Predicate<TypeExtensionTO>() {
+        return IterableUtils.find(typeExtensions, new Predicate<TypeExtensionTO>() {
 
             @Override
             public boolean evaluate(final TypeExtensionTO typeExtension) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/common/lib/src/main/java/org/apache/syncope/common/lib/to/MappingTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/MappingTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/MappingTO.java
index 73c0523..89fab1e 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/MappingTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/MappingTO.java
@@ -25,7 +25,7 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.AbstractBaseBean;
 import org.apache.syncope.common.lib.types.IntMappingType;
@@ -51,7 +51,7 @@ public class MappingTO extends AbstractBaseBean {
     }
 
     public MappingItemTO getConnObjectKeyItem() {
-        return CollectionUtils.find(getItems(), new Predicate<MappingItemTO>() {
+        return IterableUtils.find(getItems(), new Predicate<MappingItemTO>() {
 
             @Override
             public boolean evaluate(final MappingItemTO item) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java
index a74042f..a4f56ab 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java
@@ -30,7 +30,7 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.ConnConfProperty;
 import org.apache.syncope.common.lib.types.ConnectorCapability;
@@ -183,7 +183,7 @@ public class ResourceTO extends AbstractAnnotatedBean {
 
     @JsonIgnore
     public ProvisionTO getProvision(final String anyType) {
-        return CollectionUtils.find(provisions, new Predicate<ProvisionTO>() {
+        return IterableUtils.find(provisions, new Predicate<ProvisionTO>() {
 
             @Override
             public boolean evaluate(final ProvisionTO provisionTO) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractAnyLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractAnyLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractAnyLogic.java
index 18b9429..f108052 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractAnyLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractAnyLogic.java
@@ -24,6 +24,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.apache.commons.lang3.tuple.Pair;
@@ -179,7 +180,7 @@ public abstract class AbstractAnyLogic<TO extends AnyTO, P extends AnyPatch>
 
         @Override
         public boolean evaluate(final String realm) {
-            return CollectionUtils.exists(targets, new Predicate<String>() {
+            return IterableUtils.matchesAny(targets, new Predicate<String>() {
 
                 @Override
                 public boolean evaluate(final String target) {
@@ -205,7 +206,7 @@ public abstract class AbstractAnyLogic<TO extends AnyTO, P extends AnyPatch>
     }
 
     protected void securityChecks(final Set<String> effectiveRealms, final String realm, final Long key) {
-        if (!CollectionUtils.exists(effectiveRealms, new Predicate<String>() {
+        if (!IterableUtils.matchesAny(effectiveRealms, new Predicate<String>() {
 
             @Override
             public boolean evaluate(final String ownedRealm) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/logic/src/main/java/org/apache/syncope/core/logic/GroupLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/GroupLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/GroupLogic.java
index 65b9a25..0e9850b 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/GroupLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/GroupLogic.java
@@ -24,6 +24,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Set;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.collections4.Transformer;
 import org.apache.commons.lang3.ArrayUtils;
@@ -81,7 +82,7 @@ public class GroupLogic extends AbstractAnyLogic<GroupTO, GroupPatch> {
 
     @Override
     protected void securityChecks(final Set<String> effectiveRealms, final String realm, final Long key) {
-        if (!CollectionUtils.exists(effectiveRealms, new Predicate<String>() {
+        if (!IterableUtils.matchesAny(effectiveRealms, new Predicate<String>() {
 
             @Override
             public boolean evaluate(final String ownedRealm) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/misc/src/main/java/org/apache/syncope/core/misc/security/AuthDataAccessor.java
----------------------------------------------------------------------
diff --git a/core/misc/src/main/java/org/apache/syncope/core/misc/security/AuthDataAccessor.java b/core/misc/src/main/java/org/apache/syncope/core/misc/security/AuthDataAccessor.java
index afca81a..7e880b4 100644
--- a/core/misc/src/main/java/org/apache/syncope/core/misc/security/AuthDataAccessor.java
+++ b/core/misc/src/main/java/org/apache/syncope/core/misc/security/AuthDataAccessor.java
@@ -28,6 +28,7 @@ import java.util.Set;
 import javax.annotation.Resource;
 import org.apache.commons.collections4.Closure;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.SetUtils;
 import org.apache.commons.collections4.Transformer;
 import org.apache.commons.lang3.tuple.ImmutablePair;
@@ -265,7 +266,7 @@ public class AuthDataAccessor {
                 // Give entitlements as assigned by roles (with realms, where applicable) - assigned either
                 // statically and dynamically
                 for (final Role role : userDAO.findAllRoles(user)) {
-                    CollectionUtils.forAllDo(role.getEntitlements(), new Closure<String>() {
+                    IterableUtils.forEach(role.getEntitlements(), new Closure<String>() {
 
                         @Override
                         public void execute(final String entitlement) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/misc/src/main/java/org/apache/syncope/core/misc/security/MustChangePasswordFilter.java
----------------------------------------------------------------------
diff --git a/core/misc/src/main/java/org/apache/syncope/core/misc/security/MustChangePasswordFilter.java b/core/misc/src/main/java/org/apache/syncope/core/misc/security/MustChangePasswordFilter.java
index 95e0116..c52d355 100644
--- a/core/misc/src/main/java/org/apache/syncope/core/misc/security/MustChangePasswordFilter.java
+++ b/core/misc/src/main/java/org/apache/syncope/core/misc/security/MustChangePasswordFilter.java
@@ -25,7 +25,7 @@ import javax.servlet.FilterConfig;
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.syncope.common.lib.types.StandardEntitlement;
@@ -55,7 +55,7 @@ public class MustChangePasswordFilter implements Filter {
             throws IOException, ServletException {
 
         if (request instanceof SecurityContextHolderAwareRequestWrapper) {
-            boolean isMustChangePassword = CollectionUtils.exists(
+            boolean isMustChangePassword = IterableUtils.matchesAny(
                     SecurityContextHolder.getContext().getAuthentication().getAuthorities(),
                     new Predicate<GrantedAuthority>() {
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/misc/src/main/java/org/apache/syncope/core/misc/security/SyncopeGrantedAuthority.java
----------------------------------------------------------------------
diff --git a/core/misc/src/main/java/org/apache/syncope/core/misc/security/SyncopeGrantedAuthority.java b/core/misc/src/main/java/org/apache/syncope/core/misc/security/SyncopeGrantedAuthority.java
index 1cdae17..706bf15 100644
--- a/core/misc/src/main/java/org/apache/syncope/core/misc/security/SyncopeGrantedAuthority.java
+++ b/core/misc/src/main/java/org/apache/syncope/core/misc/security/SyncopeGrantedAuthority.java
@@ -23,7 +23,7 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 import org.apache.commons.collections4.Closure;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.SetUtils;
 import org.apache.commons.lang3.builder.EqualsBuilder;
 import org.apache.commons.lang3.builder.HashCodeBuilder;
@@ -54,7 +54,7 @@ public class SyncopeGrantedAuthority implements GrantedAuthority {
     }
 
     public void addRealms(final Collection<String> newRealms) {
-        CollectionUtils.forAllDo(newRealms, new Closure<String>() {
+        IterableUtils.forEach(newRealms, new Closure<String>() {
 
             @Override
             public void execute(final String newRealm) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/InvalidEntityException.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/InvalidEntityException.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/InvalidEntityException.java
index 97f1a58..e0d6974 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/InvalidEntityException.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/InvalidEntityException.java
@@ -24,7 +24,7 @@ import java.util.Map;
 import java.util.Set;
 import javax.validation.ConstraintViolation;
 import javax.validation.ValidationException;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.EntityViolationType;
 
@@ -99,7 +99,7 @@ public class InvalidEntityException extends ValidationException {
     }
 
     public final boolean hasViolation(final EntityViolationType type) {
-        return CollectionUtils.exists(violations.keySet(), new Predicate<Class<?>>() {
+        return IterableUtils.matchesAny(violations.keySet(), new Predicate<Class<?>>() {
 
             @Override
             public boolean evaluate(final Class<?> entity) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
index 7a805f1..193ed8f 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
@@ -25,6 +25,7 @@ import java.util.List;
 import java.util.Set;
 import javax.persistence.TypedQuery;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.collections4.Transformer;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
@@ -64,7 +65,7 @@ public class JPAAnyObjectDAO extends AbstractAnyDAO<AnyObject> implements AnyObj
     protected void securityChecks(final AnyObject anyObject) {
         Set<String> authRealms = AuthContextUtils.getAuthorizations().get(EntitlementsHolder.getInstance().
                 getFor(anyObject.getType().getKey(), EntitlementsHolder.AnyEntitlement.READ));
-        boolean authorized = CollectionUtils.exists(authRealms, new Predicate<String>() {
+        boolean authorized = IterableUtils.matchesAny(authRealms, new Predicate<String>() {
 
             @Override
             public boolean evaluate(final String realm) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAConnInstanceDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAConnInstanceDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAConnInstanceDAO.java
index eb027e9..de2be18 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAConnInstanceDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAConnInstanceDAO.java
@@ -22,7 +22,7 @@ import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 import javax.persistence.TypedQuery;
 import org.apache.commons.collections4.Closure;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.syncope.core.persistence.api.dao.ConnInstanceDAO;
 import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO;
 import org.apache.syncope.core.persistence.api.dao.NotFoundException;
@@ -76,15 +76,14 @@ public class JPAConnInstanceDAO extends AbstractDAO<ConnInstance, Long> implemen
             return;
         }
 
-        CollectionUtils.forAllDo(new CopyOnWriteArrayList<>(connInstance.getResources()),
-                new Closure<ExternalResource>() {
+        IterableUtils.forEach(new CopyOnWriteArrayList<>(connInstance.getResources()), new Closure<ExternalResource>() {
 
-                    @Override
-                    public void execute(final ExternalResource input) {
-                        resourceDAO.delete(input.getKey());
-                    }
+            @Override
+            public void execute(final ExternalResource input) {
+                resourceDAO.delete(input.getKey());
+            }
 
-                });
+        });
 
         entityManager().remove(connInstance);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
index 7e5667c..d050d4c 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
@@ -25,7 +25,7 @@ import java.util.Map;
 import java.util.Set;
 import javax.persistence.NoResultException;
 import javax.persistence.TypedQuery;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.ResourceOperation;
@@ -75,7 +75,7 @@ public class JPAGroupDAO extends AbstractAnyDAO<Group> implements GroupDAO {
     @Override
     protected void securityChecks(final Group group) {
         Set<String> authRealms = AuthContextUtils.getAuthorizations().get(StandardEntitlement.GROUP_READ);
-        boolean authorized = CollectionUtils.exists(authRealms, new Predicate<String>() {
+        boolean authorized = IterableUtils.matchesAny(authRealms, new Predicate<String>() {
 
             @Override
             public boolean evaluate(final String realm) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARealmDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARealmDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARealmDAO.java
index 1261a5f..ecd5050 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARealmDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARealmDAO.java
@@ -23,7 +23,7 @@ import java.util.Collections;
 import java.util.List;
 import javax.persistence.NoResultException;
 import javax.persistence.TypedQuery;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.lib.SyncopeConstants;
@@ -84,7 +84,7 @@ public class JPARealmDAO extends AbstractDAO<Realm, Long> implements RealmDAO {
 
         Realm current = root;
         for (final String pathElement : fullPath.substring(1).split("/")) {
-            current = CollectionUtils.find(findChildren(current), new Predicate<Realm>() {
+            current = IterableUtils.find(findChildren(current), new Predicate<Realm>() {
 
                 @Override
                 public boolean evaluate(final Realm realm) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPATaskDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPATaskDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPATaskDAO.java
index 21a32e6..1ea8968 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPATaskDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPATaskDAO.java
@@ -22,7 +22,7 @@ import java.util.Collections;
 import java.util.List;
 import javax.persistence.Query;
 import org.apache.commons.collections4.Closure;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.TaskType;
 import org.apache.syncope.core.persistence.api.dao.TaskDAO;
@@ -168,8 +168,8 @@ public class JPATaskDAO extends AbstractDAO<Task, Long> implements TaskDAO {
 
         StringBuilder queryString = buildFindAllQuery(type, resource, anyTypeKind, anyTypeKey).
                 append(orderByClauses.isEmpty()
-                                ? "ORDER BY t.id DESC"
-                                : toOrderByStatement(getEntityReference(type), orderByClauses));
+                        ? "ORDER BY t.id DESC"
+                        : toOrderByStatement(getEntityReference(type), orderByClauses));
 
         Query query = entityManager().createQuery(queryString.toString());
         query.setParameter("type", type);
@@ -239,14 +239,14 @@ public class JPATaskDAO extends AbstractDAO<Task, Long> implements TaskDAO {
 
     @Override
     public void deleteAll(final ExternalResource resource, final TaskType type) {
-        CollectionUtils.forAllDo(
+        IterableUtils.forEach(
                 findAll(type, resource, null, null, -1, -1, Collections.<OrderByClause>emptyList()),
                 new Closure<Task>() {
 
-                    @Override
-                    public void execute(final Task input) {
-                        delete(input.getKey());
-                    }
-                });
+            @Override
+            public void execute(final Task input) {
+                delete(input.getKey());
+            }
+        });
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
index 3e5214f..a669e24 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
@@ -27,6 +27,7 @@ import javax.annotation.Resource;
 import javax.persistence.NoResultException;
 import javax.persistence.TypedQuery;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.collections4.Transformer;
 import org.apache.commons.lang3.tuple.ImmutablePair;
@@ -104,7 +105,7 @@ public class JPAUserDAO extends AbstractAnyDAO<User> implements UserDAO {
                 && !AuthContextUtils.getUsername().equals(user.getUsername())) {
 
             Set<String> authRealms = AuthContextUtils.getAuthorizations().get(StandardEntitlement.USER_READ);
-            boolean authorized = CollectionUtils.exists(authRealms, new Predicate<String>() {
+            boolean authorized = IterableUtils.matchesAny(authRealms, new Predicate<String>() {
 
                 @Override
                 public boolean evaluate(final String realm) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
index ba02c45..bb2b855 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
@@ -18,7 +18,6 @@
  */
 package org.apache.syncope.core.persistence.jpa.entity;
 
-import org.apache.syncope.core.persistence.jpa.entity.resource.JPAExternalResource;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -29,6 +28,7 @@ import javax.persistence.ManyToOne;
 import javax.persistence.MappedSuperclass;
 import javax.persistence.Transient;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.collections4.Transformer;
 import org.apache.syncope.core.persistence.api.entity.Any;
@@ -39,6 +39,7 @@ import org.apache.syncope.core.persistence.api.entity.PlainSchema;
 import org.apache.syncope.core.persistence.api.entity.Realm;
 import org.apache.syncope.core.persistence.api.entity.VirSchema;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
+import org.apache.syncope.core.persistence.jpa.entity.resource.JPAExternalResource;
 import org.apache.syncope.core.persistence.jpa.validation.entity.AnyCheck;
 
 @AnyCheck
@@ -99,7 +100,7 @@ public abstract class AbstractAny<P extends PlainAttr<?>>
 
     @Override
     public P getPlainAttr(final String plainSchemaName) {
-        return CollectionUtils.find(getPlainAttrs(), new Predicate<P>() {
+        return IterableUtils.find(getPlainAttrs(), new Predicate<P>() {
 
             @Override
             public boolean evaluate(final P plainAttr) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java
index 1c42cf0..da253de 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java
@@ -37,7 +37,7 @@ import javax.persistence.Table;
 import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.IntMappingType;
 import org.apache.syncope.common.lib.types.TraceLevel;
@@ -173,7 +173,7 @@ public class JPANotification extends AbstractEntity<Long> implements Notificatio
 
     @Override
     public AnyAbout getAbout(final AnyType anyType) {
-        return CollectionUtils.find(abouts, new Predicate<AnyAbout>() {
+        return IterableUtils.find(abouts, new Predicate<AnyAbout>() {
 
             @Override
             public boolean evaluate(final AnyAbout about) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARealm.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARealm.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARealm.java
index 8186ede..a784c68 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARealm.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARealm.java
@@ -22,8 +22,6 @@ import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import org.apache.syncope.core.persistence.jpa.entity.policy.JPAPasswordPolicy;
-import org.apache.syncope.core.persistence.jpa.entity.policy.JPAAccountPolicy;
 import javax.persistence.Cacheable;
 import javax.persistence.CascadeType;
 import javax.persistence.CollectionTable;
@@ -38,7 +36,7 @@ import javax.persistence.OneToMany;
 import javax.persistence.Table;
 import javax.persistence.UniqueConstraint;
 import javax.validation.constraints.Size;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.lib.SyncopeConstants;
@@ -48,6 +46,8 @@ import org.apache.syncope.core.persistence.api.entity.AnyType;
 import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
 import org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy;
 import org.apache.syncope.core.persistence.api.entity.Realm;
+import org.apache.syncope.core.persistence.jpa.entity.policy.JPAAccountPolicy;
+import org.apache.syncope.core.persistence.jpa.entity.policy.JPAPasswordPolicy;
 import org.apache.syncope.core.persistence.jpa.validation.entity.RealmCheck;
 
 @Entity
@@ -160,7 +160,7 @@ public class JPARealm extends AbstractEntity<Long> implements Realm {
 
     @Override
     public AnyTemplateRealm getTemplate(final AnyType anyType) {
-        return CollectionUtils.find(templates, new Predicate<AnyTemplate>() {
+        return IterableUtils.find(templates, new Predicate<AnyTemplate>() {
 
             @Override
             public boolean evaluate(final AnyTemplate template) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAAnyObject.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAAnyObject.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAAnyObject.java
index 10ba2fb..955d168 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAAnyObject.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAAnyObject.java
@@ -35,6 +35,7 @@ import javax.persistence.Table;
 import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.core.persistence.api.entity.AnyType;
 import org.apache.syncope.core.persistence.api.entity.AnyTypeClass;
@@ -159,7 +160,7 @@ public class JPAAnyObject extends AbstractAny<APlainAttr> implements AnyObject {
 
     @Override
     public ARelationship getRelationship(final RelationshipType relationshipType, final Long anyObjectKey) {
-        return CollectionUtils.find(getRelationships(), new Predicate<ARelationship>() {
+        return IterableUtils.find(getRelationships(), new Predicate<ARelationship>() {
 
             @Override
             public boolean evaluate(final ARelationship relationship) {
@@ -211,7 +212,7 @@ public class JPAAnyObject extends AbstractAny<APlainAttr> implements AnyObject {
 
     @Override
     public AMembership getMembership(final Long groupKey) {
-        return CollectionUtils.find(getMemberships(), new Predicate<AMembership>() {
+        return IterableUtils.find(getMemberships(), new Predicate<AMembership>() {
 
             @Override
             public boolean evaluate(final AMembership membership) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
index b481fb0..48453ca 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
@@ -28,7 +28,7 @@ import javax.persistence.Id;
 import javax.persistence.OneToMany;
 import javax.persistence.Table;
 import javax.validation.Valid;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.core.persistence.api.entity.AnyType;
 import org.apache.syncope.core.persistence.api.entity.AnyTypeClass;
@@ -78,7 +78,7 @@ public class JPAConf extends AbstractAnnotatedEntity<Long> implements Conf {
 
     @Override
     public CPlainAttr getPlainAttr(final String plainSchemaName) {
-        return CollectionUtils.find(plainAttrs, new Predicate<CPlainAttr>() {
+        return IterableUtils.find(plainAttrs, new Predicate<CPlainAttr>() {
 
             @Override
             public boolean evaluate(final CPlainAttr plainAttr) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPAGroup.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPAGroup.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPAGroup.java
index d41ef3a..e7a5579 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPAGroup.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPAGroup.java
@@ -35,7 +35,7 @@ import javax.persistence.OneToOne;
 import javax.persistence.Table;
 import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.core.misc.spring.ApplicationContextProvider;
 import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
@@ -230,7 +230,7 @@ public class JPAGroup extends AbstractAny<GPlainAttr> implements Group {
 
     @Override
     public TypeExtension getTypeExtension(final AnyType anyType) {
-        return CollectionUtils.find(typeExtensions, new Predicate<TypeExtension>() {
+        return IterableUtils.find(typeExtensions, new Predicate<TypeExtension>() {
 
             @Override
             public boolean evaluate(final TypeExtension typeExtension) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
index 0653cf3..1f10447 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
@@ -41,6 +41,7 @@ import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.lib.types.ConnConfProperty;
@@ -217,7 +218,7 @@ public class JPAExternalResource extends AbstractAnnotatedEntity<String> impleme
 
     @Override
     public Provision getProvision(final ObjectClass objectClass) {
-        return CollectionUtils.find(provisions, new Predicate<Provision>() {
+        return IterableUtils.find(provisions, new Predicate<Provision>() {
 
             @Override
             public boolean evaluate(final Provision provision) {
@@ -228,7 +229,7 @@ public class JPAExternalResource extends AbstractAnnotatedEntity<String> impleme
 
     @Override
     public Provision getProvision(final AnyType anyType) {
-        return CollectionUtils.find(provisions, new Predicate<Provision>() {
+        return IterableUtils.find(provisions, new Predicate<Provision>() {
 
             @Override
             public boolean evaluate(final Provision provision) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAMapping.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAMapping.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAMapping.java
index 872fee7..752115c 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAMapping.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAMapping.java
@@ -29,7 +29,7 @@ import javax.persistence.OneToMany;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
 import javax.validation.constraints.NotNull;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.IntMappingType;
 import org.apache.syncope.core.persistence.api.entity.resource.Mapping;
@@ -96,7 +96,7 @@ public class JPAMapping extends AbstractEntity<Long> implements Mapping {
 
     @Override
     public MappingItem getConnObjectKeyItem() {
-        return CollectionUtils.find(getItems(), new Predicate<MappingItem>() {
+        return IterableUtils.find(getItems(), new Predicate<MappingItem>() {
 
             @Override
             public boolean evaluate(final MappingItem item) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPAPushTask.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPAPushTask.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPAPushTask.java
index 190cc0f..bbf3242 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPAPushTask.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPAPushTask.java
@@ -31,7 +31,7 @@ import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.JoinColumn;
 import javax.persistence.OneToMany;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.TaskType;
 import org.apache.syncope.core.persistence.api.entity.AnyType;
@@ -80,7 +80,7 @@ public class JPAPushTask extends AbstractProvisioningTask implements PushTask {
 
     @Override
     public AnyFilter getFilter(final AnyType anyType) {
-        return CollectionUtils.find(filters, new Predicate<AnyFilter>() {
+        return IterableUtils.find(filters, new Predicate<AnyFilter>() {
 
             @Override
             public boolean evaluate(final AnyFilter filter) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPASyncTask.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPASyncTask.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPASyncTask.java
index 935d76c..b48a6e3 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPASyncTask.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPASyncTask.java
@@ -35,7 +35,7 @@ import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
 import javax.persistence.OneToMany;
 import javax.validation.constraints.NotNull;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.SyncMode;
 import org.apache.syncope.common.lib.types.TaskType;
@@ -128,7 +128,7 @@ public class JPASyncTask extends AbstractProvisioningTask implements SyncTask {
 
     @Override
     public AnyTemplateSyncTask getTemplate(final AnyType anyType) {
-        return CollectionUtils.find(templates, new Predicate<AnyTemplate>() {
+        return IterableUtils.find(templates, new Predicate<AnyTemplate>() {
 
             @Override
             public boolean evaluate(final AnyTemplate template) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
index 3626804..e4a6711 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
@@ -49,6 +49,7 @@ import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.CipherAlgorithm;
 import org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion;
@@ -504,7 +505,7 @@ public class JPAUser extends AbstractAny<UPlainAttr> implements User {
 
     @Override
     public URelationship getRelationship(final RelationshipType relationshipType, final Long anyObjectKey) {
-        return CollectionUtils.find(getRelationships(), new Predicate<URelationship>() {
+        return IterableUtils.find(getRelationships(), new Predicate<URelationship>() {
 
             @Override
             public boolean evaluate(final URelationship relationship) {
@@ -556,7 +557,7 @@ public class JPAUser extends AbstractAny<UPlainAttr> implements User {
 
     @Override
     public UMembership getMembership(final Long groupKey) {
-        return CollectionUtils.find(getMemberships(), new Predicate<UMembership>() {
+        return IterableUtils.find(getMemberships(), new Predicate<UMembership>() {
 
             @Override
             public boolean evaluate(final UMembership membership) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/ExternalResourceValidator.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/ExternalResourceValidator.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/ExternalResourceValidator.java
index 2f97699..941e63c 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/ExternalResourceValidator.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/ExternalResourceValidator.java
@@ -21,7 +21,7 @@ package org.apache.syncope.core.persistence.jpa.validation.entity;
 import java.util.HashSet;
 import java.util.Set;
 import javax.validation.ConstraintValidatorContext;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.lib.types.EntityViolationType;
@@ -122,7 +122,7 @@ public class ExternalResourceValidator extends AbstractValidator<ExternalResourc
             return true;
         }
 
-        int connObjectKeys = CollectionUtils.countMatches(mapping.getItems(), new Predicate<MappingItem>() {
+        long connObjectKeys = IterableUtils.countMatches(mapping.getItems(), new Predicate<MappingItem>() {
 
             @Override
             public boolean evaluate(final MappingItem item) {
@@ -218,7 +218,7 @@ public class ExternalResourceValidator extends AbstractValidator<ExternalResourc
 
         final Set<AnyType> anyTypes = new HashSet<>();
         final Set<String> objectClasses = new HashSet<>();
-        boolean validMappings = CollectionUtils.matchesAll(resource.getProvisions(), new Predicate<Provision>() {
+        boolean validMappings = IterableUtils.matchesAll(resource.getProvisions(), new Predicate<Provision>() {
 
             @Override
             public boolean evaluate(final Provision provision) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/AnySearchTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/AnySearchTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/AnySearchTest.java
index 4045a76..db26b96 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/AnySearchTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/AnySearchTest.java
@@ -28,7 +28,7 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
@@ -383,7 +383,7 @@ public class AnySearchTest extends AbstractTest {
         users = searchDAO.search(searchCondition, AnyTypeKind.USER);
         assertNotNull(users);
         assertEquals(2, users.size());
-        assertTrue(CollectionUtils.exists(users, new Predicate<User>() {
+        assertTrue(IterableUtils.matchesAny(users, new Predicate<User>() {
 
             @Override
             public boolean evaluate(User user) {
@@ -426,14 +426,14 @@ public class AnySearchTest extends AbstractTest {
         List<Any<?>> matching = searchDAO.search(searchCondition, AnyTypeKind.ANY_OBJECT);
         assertNotNull(matching);
         assertEquals(2, matching.size());
-        assertTrue(CollectionUtils.exists(matching, new Predicate<Any<?>>() {
+        assertTrue(IterableUtils.matchesAny(matching, new Predicate<Any<?>>() {
 
             @Override
             public boolean evaluate(final Any<?> any) {
                 return any.getKey() == 1L;
             }
         }));
-        assertTrue(CollectionUtils.exists(matching, new Predicate<Any<?>>() {
+        assertTrue(IterableUtils.matchesAny(matching, new Predicate<Any<?>>() {
 
             @Override
             public boolean evaluate(final Any<?> any) {
@@ -446,7 +446,7 @@ public class AnySearchTest extends AbstractTest {
         matching = searchDAO.search(searchCondition, AnyTypeKind.USER);
         assertNotNull(matching);
         assertEquals(2, matching.size());
-        assertTrue(CollectionUtils.exists(matching, new Predicate<Any<?>>() {
+        assertTrue(IterableUtils.matchesAny(matching, new Predicate<Any<?>>() {
 
             @Override
             public boolean evaluate(final Any<?> any) {
@@ -508,14 +508,14 @@ public class AnySearchTest extends AbstractTest {
         assertTrue(searchCondition.isValid());
 
         List<Group> groups = searchDAO.search(searchCondition, AnyTypeKind.GROUP);
-        assertTrue(CollectionUtils.exists(groups, new Predicate<Group>() {
+        assertTrue(IterableUtils.matchesAny(groups, new Predicate<Group>() {
 
             @Override
             public boolean evaluate(final Group group) {
                 return group.getKey().equals(15L);
             }
         }));
-        assertFalse(CollectionUtils.exists(groups, new Predicate<Group>() {
+        assertFalse(IterableUtils.matchesAny(groups, new Predicate<Group>() {
 
             @Override
             public boolean evaluate(final Group group) {
@@ -529,7 +529,7 @@ public class AnySearchTest extends AbstractTest {
         assertTrue(searchCondition.isValid());
 
         List<AnyObject> anyObjects = searchDAO.search(searchCondition, AnyTypeKind.ANY_OBJECT);
-        assertFalse(CollectionUtils.exists(anyObjects, new Predicate<AnyObject>() {
+        assertFalse(IterableUtils.matchesAny(anyObjects, new Predicate<AnyObject>() {
 
             @Override
             public boolean evaluate(final AnyObject anyObject) {
@@ -553,7 +553,7 @@ public class AnySearchTest extends AbstractTest {
         List<User> users = searchDAO.search(searchCondition, AnyTypeKind.USER);
         assertNotNull(users);
         assertEquals(2, users.size());
-        assertTrue(CollectionUtils.exists(users, new Predicate<User>() {
+        assertTrue(IterableUtils.matchesAny(users, new Predicate<User>() {
 
             @Override
             public boolean evaluate(User user) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ResourceTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ResourceTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ResourceTest.java
index 3cc3efa..828ce6c 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ResourceTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ResourceTest.java
@@ -26,7 +26,7 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.util.List;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.EntityViolationType;
@@ -69,7 +69,7 @@ public class ResourceTest extends AbstractTest {
         Mapping mapping = resource.getProvision(anyTypeDAO.findUser()).getMapping();
         assertFalse("no mapping specified", mapping.getItems().isEmpty());
 
-        assertTrue(CollectionUtils.exists(mapping.getItems(), new Predicate<MappingItem>() {
+        assertTrue(IterableUtils.matchesAny(mapping.getItems(), new Predicate<MappingItem>() {
 
             @Override
             public boolean evaluate(final MappingItem item) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java
index 70914ae..aa0549b 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java
@@ -21,7 +21,7 @@ package org.apache.syncope.core.provisioning.java.data;
 import org.apache.syncope.core.provisioning.api.data.ConnInstanceDataBinder;
 import java.util.Arrays;
 import java.util.Collection;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.ConnInstanceTO;
@@ -190,7 +190,7 @@ public class ConnInstanceDataBinderImpl implements ConnInstanceDataBinder {
         for (final String propName : properties.getPropertyNames()) {
             ConnConfPropSchema schema = build(properties.getProperty(propName));
 
-            ConnConfProperty property = CollectionUtils.find(connInstanceTO.getConf(),
+            ConnConfProperty property = IterableUtils.find(connInstanceTO.getConf(),
                     new Predicate<ConnConfProperty>() {
 
                         @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
index 22d690a..9fe5ee2 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
@@ -27,6 +27,7 @@ import java.util.Map;
 import java.util.Set;
 import javax.annotation.Resource;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.collections4.Transformer;
 import org.apache.commons.lang3.StringUtils;
@@ -275,7 +276,7 @@ public class UserDataBinderImpl extends AbstractAnyDataBinder implements UserDat
 
         Provision provision = resource.getProvision(anyTypeDAO.findUser());
         if (provision != null && provision.getMapping() != null) {
-            result = CollectionUtils.exists(provision.getMapping().getItems(), new Predicate<MappingItem>() {
+            result = IterableUtils.matchesAny(provision.getMapping().getItems(), new Predicate<MappingItem>() {
 
                 @Override
                 public boolean evaluate(final MappingItem item) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DBPasswordPropagationActions.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DBPasswordPropagationActions.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DBPasswordPropagationActions.java
index 6910c19..117722c 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DBPasswordPropagationActions.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DBPasswordPropagationActions.java
@@ -20,7 +20,7 @@ package org.apache.syncope.core.provisioning.java.propagation;
 
 import java.util.HashSet;
 import java.util.Set;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.CipherAlgorithm;
@@ -88,7 +88,7 @@ public class DBPasswordPropagationActions extends DefaultPropagationActions {
 
     private String getCipherAlgorithm(final ConnInstance connInstance) {
         ConnConfProperty cipherAlgorithm =
-                CollectionUtils.find(connInstance.getConf(), new Predicate<ConnConfProperty>() {
+                IterableUtils.find(connInstance.getConf(), new Predicate<ConnConfProperty>() {
 
                     @Override
                     public boolean evaluate(final ConnConfProperty property) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DefaultPropagationReporter.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DefaultPropagationReporter.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DefaultPropagationReporter.java
index 8e780f4..55c4a0b 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DefaultPropagationReporter.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DefaultPropagationReporter.java
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.to.PropagationStatus;
 import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
@@ -44,7 +44,7 @@ public class DefaultPropagationReporter implements PropagationReporter {
     protected final List<PropagationStatus> statuses = new ArrayList<>();
 
     protected boolean add(final PropagationStatus status) {
-        return CollectionUtils.exists(statuses, new Predicate<PropagationStatus>() {
+        return IterableUtils.matchesAny(statuses, new Predicate<PropagationStatus>() {
 
             @Override
             public boolean evaluate(final PropagationStatus item) {
@@ -83,7 +83,7 @@ public class DefaultPropagationReporter implements PropagationReporter {
     public void onPriorityResourceFailure(final String failingResource, final Collection<PropagationTask> tasks) {
         LOG.debug("Propagation error: {} priority resource failed to propagate", failingResource);
 
-        final PropagationTask propagationTask = CollectionUtils.find(tasks, new Predicate<PropagationTask>() {
+        final PropagationTask propagationTask = IterableUtils.find(tasks, new Predicate<PropagationTask>() {
 
             @Override
             public boolean evaluate(final PropagationTask task) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/LDAPPasswordPropagationActions.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/LDAPPasswordPropagationActions.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/LDAPPasswordPropagationActions.java
index 3ba0dc9..1447f43 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/LDAPPasswordPropagationActions.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/LDAPPasswordPropagationActions.java
@@ -20,7 +20,7 @@ package org.apache.syncope.core.provisioning.java.propagation;
 
 import java.util.HashSet;
 import java.util.Set;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.CipherAlgorithm;
@@ -94,7 +94,7 @@ public class LDAPPasswordPropagationActions extends DefaultPropagationActions {
 
     private String getCipherAlgorithm(final ConnInstance connInstance) {
         ConnConfProperty cipherAlgorithm =
-                CollectionUtils.find(connInstance.getConf(), new Predicate<ConnConfProperty>() {
+                IterableUtils.find(connInstance.getConf(), new Predicate<ConnConfProperty>() {
 
                     @Override
                     public boolean evaluate(final ConnConfProperty property) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/DBPasswordSyncActions.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/DBPasswordSyncActions.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/DBPasswordSyncActions.java
index 4032b23..6e8af59 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/DBPasswordSyncActions.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/DBPasswordSyncActions.java
@@ -18,7 +18,7 @@
  */
 package org.apache.syncope.core.provisioning.java.sync;
 
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.patch.AnyPatch;
 import org.apache.syncope.common.lib.patch.PasswordPatch;
@@ -108,7 +108,7 @@ public class DBPasswordSyncActions extends DefaultSyncActions {
 
     private String getCipherAlgorithm(final ConnInstance connInstance) {
         ConnConfProperty cipherAlgorithm =
-                CollectionUtils.find(connInstance.getConf(), new Predicate<ConnConfProperty>() {
+                IterableUtils.find(connInstance.getConf(), new Predicate<ConnConfProperty>() {
 
                     @Override
                     public boolean evaluate(final ConnConfProperty property) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/LDAPMembershipSyncActions.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/LDAPMembershipSyncActions.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/LDAPMembershipSyncActions.java
index ff81b02..4cf1b54 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/LDAPMembershipSyncActions.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/LDAPMembershipSyncActions.java
@@ -22,7 +22,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.syncope.common.lib.patch.AnyPatch;
@@ -110,7 +110,7 @@ public class LDAPMembershipSyncActions extends DefaultSyncActions {
      * @return the name of the attribute used to keep track of group memberships
      */
     protected String getGroupMembershipAttrName(final Connector connector) {
-        ConnConfProperty groupMembership = CollectionUtils.find(connector.getConnInstance().getConf(),
+        ConnConfProperty groupMembership = IterableUtils.find(connector.getConnInstance().getConf(),
                 new Predicate<ConnConfProperty>() {
 
                     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUtils.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUtils.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUtils.java
index f598410..a11dcfa 100644
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUtils.java
+++ b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUtils.java
@@ -18,7 +18,7 @@
  */
 package org.apache.syncope.core.workflow.activiti;
 
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.core.persistence.api.entity.user.UMembership;
 import org.apache.syncope.core.persistence.api.entity.user.User;
@@ -28,7 +28,7 @@ public class ActivitiUtils {
 
     @Transactional(readOnly = true)
     public boolean isUserIngroup(final User user, final Long groupKey) {
-        return CollectionUtils.exists(user.getMemberships(), new Predicate<UMembership>() {
+        return IterableUtils.matchesAny(user.getMemberships(), new Predicate<UMembership>() {
 
             @Override
             public boolean evaluate(final UMembership membership) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncActions.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncActions.java b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncActions.java
index de2b417..dbe1bd1 100644
--- a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncActions.java
+++ b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncActions.java
@@ -18,7 +18,7 @@
  */
 package org.apache.syncope.fit.core.reference;
 
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.syncope.common.lib.patch.AnyPatch;
 import org.apache.syncope.common.lib.patch.AttrPatch;
 import org.apache.syncope.common.lib.to.AnyTO;
@@ -45,7 +45,7 @@ public class TestSyncActions extends DefaultSyncActions {
 
         AttrTO attrTO = null;
         for (int i = 0; i < any.getPlainAttrs().size(); i++) {
-            AttrTO plainAttr = CollectionUtils.get(any.getPlainAttrs(), i);
+            AttrTO plainAttr = IterableUtils.get(any.getPlainAttrs(), i);
             if ("fullname".equals(plainAttr.getSchema())) {
                 attrTO = plainAttr;
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AbstractTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AbstractTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AbstractTaskITCase.java
index 41f287a..c0991a4 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AbstractTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AbstractTaskITCase.java
@@ -33,7 +33,7 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
-import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.to.AbstractTaskTO;
 import org.apache.syncope.common.lib.to.NotificationTaskTO;
@@ -170,7 +170,7 @@ public abstract class AbstractTaskITCase extends AbstractITCase {
         assertNotNull(tasks);
         assertFalse(tasks.getResult().isEmpty());
 
-        return CollectionUtils.find(tasks.getResult(), new Predicate<NotificationTaskTO>() {
+        return IterableUtils.find(tasks.getResult(), new Predicate<NotificationTaskTO>() {
 
             @Override
             public boolean evaluate(final NotificationTaskTO task) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2030cd27/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AuthenticationITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AuthenticationITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AuthenticationITCase.java
index 580a209..a7f74ee 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AuthenticationITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AuthenticationITCase.java
@@ -31,6 +31,7 @@ import java.util.Set;
 import javax.ws.rs.core.GenericType;
 import javax.ws.rs.core.Response;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.collections4.Transformer;
 import org.apache.commons.lang3.tuple.Pair;
@@ -226,7 +227,7 @@ public class AuthenticationITCase extends AbstractITCase {
                 new AnySearchQuery.Builder().realm("/even/two").
                 fiql(SyncopeClient.getUserSearchConditionBuilder().isNotNull("loginDate").query()).build());
         assertNotNull(matchedUsers);
-        assertTrue(CollectionUtils.matchesAll(matchedUsers.getResult(), new Predicate<UserTO>() {
+        assertTrue(IterableUtils.matchesAll(matchedUsers.getResult(), new Predicate<UserTO>() {
 
             @Override
             public boolean evaluate(final UserTO matched) {
@@ -398,7 +399,7 @@ public class AuthenticationITCase extends AbstractITCase {
         final String anyTypeKey = "FOLDER " + getUUIDString();
 
         // 1. no entitlement exists (yet) for the any type to be created
-        assertFalse(CollectionUtils.exists(syncopeService.info().getEntitlements(), new Predicate<String>() {
+        assertFalse(IterableUtils.matchesAny(syncopeService.info().getEntitlements(), new Predicate<String>() {
 
             @Override
             public boolean evaluate(final String entitlement) {
@@ -424,7 +425,7 @@ public class AuthenticationITCase extends AbstractITCase {
         anyTypeService.create(anyTypeTO);
 
         // 2. now entitlement exists for the any type just created
-        assertTrue(CollectionUtils.exists(syncopeService.info().getEntitlements(), new Predicate<String>() {
+        assertTrue(IterableUtils.matchesAny(syncopeService.info().getEntitlements(), new Predicate<String>() {
 
             @Override
             public boolean evaluate(final String entitlement) {


Mime
View raw message