[MSHARED-841] Upgrade to Commons Collections 4.2

diff --git a/pom.xml b/pom.xml
index 27ef7ca..4689989 100644
--- a/pom.xml
+++ b/pom.xml
@@ -99,11 +99,12 @@
     </dependency>
 
     <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
-      <version>3.1</version>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-collections4</artifactId>
+      <version>4.2</version><!-- Java 7 -->
     </dependency>
 
+
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
diff --git a/src/main/java/org/apache/maven/shared/jar/classes/ImportVisitor.java b/src/main/java/org/apache/maven/shared/jar/classes/ImportVisitor.java
index 94026d1..21edbbe 100644
--- a/src/main/java/org/apache/maven/shared/jar/classes/ImportVisitor.java
+++ b/src/main/java/org/apache/maven/shared/jar/classes/ImportVisitor.java
@@ -23,7 +23,7 @@
 import org.apache.bcel.classfile.ConstantUtf8;
 import org.apache.bcel.classfile.EmptyVisitor;
 import org.apache.bcel.classfile.JavaClass;
-import org.apache.commons.collections.list.SetUniqueList;
+import org.apache.commons.collections4.list.SetUniqueList;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -68,7 +68,7 @@
 
         // Create a list that is guaranteed to be unique while retaining it's list qualities (LinkedHashSet does not
         // expose the list interface even if natural ordering is retained)  
-        this.imports = SetUniqueList.decorate( new ArrayList<String>() );
+        this.imports = SetUniqueList.setUniqueList( new ArrayList<String>() );
     }
 
     /**
diff --git a/src/main/java/org/apache/maven/shared/jar/classes/JarClasses.java b/src/main/java/org/apache/maven/shared/jar/classes/JarClasses.java
index b17298e..a9744d0 100644
--- a/src/main/java/org/apache/maven/shared/jar/classes/JarClasses.java
+++ b/src/main/java/org/apache/maven/shared/jar/classes/JarClasses.java
@@ -19,7 +19,7 @@
  * under the License.
  */
 
-import org.apache.commons.collections.list.SetUniqueList;
+import org.apache.commons.collections4.list.SetUniqueList;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -71,10 +71,10 @@
     {
         // Unique list decorators are used to ensure natural ordering is retained, the list interface is availble, and
         // that duplicates are not entered.
-        imports = SetUniqueList.decorate( new ArrayList<String>() );
-        packages = SetUniqueList.decorate( new ArrayList<String>() );
-        classNames = SetUniqueList.decorate( new ArrayList<String>() );
-        methods = SetUniqueList.decorate( new ArrayList<String>() );
+        imports = SetUniqueList.setUniqueList( new ArrayList<String>() );
+        packages = SetUniqueList.setUniqueList( new ArrayList<String>() );
+        classNames = SetUniqueList.setUniqueList( new ArrayList<String>() );
+        methods = SetUniqueList.setUniqueList( new ArrayList<String>() );
     }
 
     /**
diff --git a/src/main/java/org/apache/maven/shared/jar/identification/exposers/TimestampExposer.java b/src/main/java/org/apache/maven/shared/jar/identification/exposers/TimestampExposer.java
index 5443985..ef67913 100644
--- a/src/main/java/org/apache/maven/shared/jar/identification/exposers/TimestampExposer.java
+++ b/src/main/java/org/apache/maven/shared/jar/identification/exposers/TimestampExposer.java
@@ -19,8 +19,8 @@
  * under the License.
  */
 
-import org.apache.commons.collections.Bag;
-import org.apache.commons.collections.bag.HashBag;
+import org.apache.commons.collections4.Bag;
+import org.apache.commons.collections4.bag.HashBag;
 import org.apache.maven.shared.jar.JarAnalyzer;
 import org.apache.maven.shared.jar.identification.JarIdentification;
 import org.apache.maven.shared.jar.identification.JarIdentificationExposer;
@@ -44,7 +44,7 @@
     {
         List<JarEntry> entries = jarAnalyzer.getEntries();
         SimpleDateFormat tsformat = new SimpleDateFormat( "yyyyMMdd", Locale.US ); //$NON-NLS-1$
-        Bag timestamps = new HashBag();
+        Bag<String> timestamps = new HashBag<>();
         for ( JarEntry entry : entries )
         {
             long time = entry.getTime();
@@ -54,12 +54,12 @@
 
         String ts = "";
         int tsmax = 0;
-        for ( Object timestamp : timestamps )
+        for ( String timestamp : timestamps )
         {
             int count = timestamps.getCount( timestamp );
             if ( count > tsmax )
             {
-                ts = (String) timestamp;
+                ts = timestamp;
                 tsmax = count;
             }
         }