Remove redundant type specifications.

Change-Id: Ia01c0278f1d725700dfbd24df169e8917c5234de
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AdditionalCoreMatchers.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AdditionalCoreMatchers.java
index 492f4ea..f204316 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AdditionalCoreMatchers.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AdditionalCoreMatchers.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2015, 2017 SAP SE and others.
+ * Copyright (c) 2015, 2020 SAP SE and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -14,7 +14,9 @@
 package org.eclipse.equinox.p2.tests;
 
 import java.util.Collection;
-import org.hamcrest.*;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
 
 public class AdditionalCoreMatchers {
 
@@ -24,7 +26,7 @@
 	 * @see CoreMatchers#hasItem(Matcher)
 	 */
 	public static <T> Matcher<Collection<? extends T>> hasSize(final int size) {
-		return new TypeSafeMatcher<Collection<? extends T>>() {
+		return new TypeSafeMatcher<>() {
 
 			@Override
 			public void describeTo(Description description) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java
index 454736c..2ae9e0e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java
@@ -148,7 +148,7 @@
 
 	@Test
 	public void testIntersection() {
-		IQuery<String> ABC = new MatchQuery<String>() {
+		IQuery<String> ABC = new MatchQuery<>() {
 			@Override
 			public boolean isMatch(String candidate) {
 				if (candidate.equals("A") || candidate.equals("B") || candidate.equals("C"))
@@ -157,7 +157,7 @@
 			}
 		};
 
-		IQuery<String> BCDE = new MatchQuery<String>() {
+		IQuery<String> BCDE = new MatchQuery<>() {
 			@Override
 			public boolean isMatch(String candidate) {
 				if (candidate.equals("B") || candidate.equals("C") || candidate.equals("D") || candidate.equals("E"))
@@ -210,7 +210,7 @@
 
 	@Test
 	public void testUnion() {
-		IQuery<String> ABC = new MatchQuery<String>() {
+		IQuery<String> ABC = new MatchQuery<>() {
 			@Override
 			public boolean isMatch(String candidate) {
 				if (candidate.equals("A") || candidate.equals("B") || candidate.equals("C"))
@@ -219,7 +219,7 @@
 			}
 		};
 
-		IQuery<String> BCDE = new MatchQuery<String>() {
+		IQuery<String> BCDE = new MatchQuery<>() {
 			@Override
 			public boolean isMatch(String candidate) {
 				if (candidate.equals("B") || candidate.equals("C") || candidate.equals("D") || candidate.equals("E"))
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java
index d32cc2b..a1865ab 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java
@@ -14,8 +14,13 @@
  *******************************************************************************/
 package org.eclipse.equinox.p2.tests.core;
 
-import java.util.*;
-import org.eclipse.equinox.p2.query.*;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.equinox.p2.query.Collector;
+import org.eclipse.equinox.p2.query.IQuery;
+import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.MatchQuery;
 import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
 
 /**
@@ -50,7 +55,7 @@
 	public void testCompositeCollectors() {
 		String[] s = new String[] {"A", "B", "C", "D", "E", "F", "G", "1", "2", "3", "4", "5", "6", "7"};
 		List<String> list = Arrays.asList(s);
-		IQuery<String> numeric = new MatchQuery<String>() {
+		IQuery<String> numeric = new MatchQuery<>() {
 
 			@Override
 			public boolean isMatch(String candidate) {
@@ -61,7 +66,7 @@
 			}
 		};
 
-		IQuery<String> fourOrFiveOrABC = new MatchQuery<String>() {
+		IQuery<String> fourOrFiveOrABC = new MatchQuery<>() {
 			@Override
 			public boolean isMatch(String candidate) {
 				if (candidate.equals("4") || candidate.equals("5") || candidate.equals("A") || candidate.equals("B") || candidate.equals("C")) {
@@ -82,7 +87,7 @@
 	public void testSameCollector() {
 		String[] s = new String[] {"A", "B", "C", "D", "E", "F", "G", "1", "2", "3", "4", "5", "6", "7"};
 		List<String> list = Arrays.asList(s);
-		IQuery<String> numeric = new MatchQuery<String>() {
+		IQuery<String> numeric = new MatchQuery<>() {
 
 			@Override
 			public boolean isMatch(String candidate) {
@@ -93,7 +98,7 @@
 			}
 		};
 
-		IQuery<String> fourOrFiveOrABC = new MatchQuery<String>() {
+		IQuery<String> fourOrFiveOrABC = new MatchQuery<>() {
 			@Override
 			public boolean isMatch(String candidate) {
 				if (candidate.equals("4") || candidate.equals("5") || candidate.equals("A") || candidate.equals("B") || candidate.equals("C")) {
@@ -117,7 +122,7 @@
 	public void testEmptyCompositeCollectors() {
 		String[] s = new String[] {"A", "B", "C", "D", "E", "F", "G", "1", "2", "3", "4", "5", "6", "7"};
 		List<String> list = Arrays.asList(s);
-		IQuery<String> eightOrNine = new MatchQuery<String>() {
+		IQuery<String> eightOrNine = new MatchQuery<>() {
 
 			@Override
 			public boolean isMatch(String candidate) {
@@ -128,7 +133,7 @@
 			}
 		};
 
-		IQuery<String> fourOrFiveOrABC = new MatchQuery<String>() {
+		IQuery<String> fourOrFiveOrABC = new MatchQuery<>() {
 			@Override
 			public boolean isMatch(String candidate) {
 				if (candidate.equals("4") || candidate.equals("5") || candidate.equals("A") || candidate.equals("B") || candidate.equals("C")) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java
index 8a71e2b..d8b434d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java
@@ -71,7 +71,7 @@
 		return Arrays.asList(array).iterator();
 	}
 
-	IQueryable<Integer> queryable1 = new IQueryable<Integer>() {
+	IQueryable<Integer> queryable1 = new IQueryable<>() {
 		Integer[] elements = new Integer[] {1, 2, 3, 4, 5};
 
 		@Override
@@ -88,7 +88,7 @@
 		}
 	};
 
-	IQueryable<Integer> queryable2 = new IQueryable<Integer>() {
+	IQueryable<Integer> queryable2 = new IQueryable<>() {
 		Integer[] elements = new Integer[] {4, 6, 8, 10, 12};
 
 		@Override
@@ -105,7 +105,7 @@
 		}
 	};
 
-	IQueryable<Integer> queryable3 = new IQueryable<Integer>() {
+	IQueryable<Integer> queryable3 = new IQueryable<>() {
 		Integer[] elements = new Integer[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
 
 		@Override
@@ -122,7 +122,7 @@
 		}
 	};
 
-	IQuery<Integer> matchQuery = new MatchQuery<Integer>() {
+	IQuery<Integer> matchQuery = new MatchQuery<>() {
 
 		@Override
 		public boolean isMatch(Integer candidate) {
@@ -133,7 +133,7 @@
 		}
 	};
 
-	IQuery<Integer> matchMod4query = new MatchQuery<Integer>() {
+	IQuery<Integer> matchMod4query = new MatchQuery<>() {
 		@Override
 		public boolean isMatch(Integer candidate) {
 			int x = candidate.intValue();
@@ -143,7 +143,7 @@
 		}
 	};
 
-	IQuery<Integer> contextQuery = new ContextQuery<Integer>() {
+	IQuery<Integer> contextQuery = new ContextQuery<>() {
 
 		@Override
 		public Collector<Integer> perform(Iterator<Integer> iterator) {
@@ -159,7 +159,7 @@
 
 	};
 
-	IQuery<Integer> greatestNumberQuery = new ContextQuery<Integer>() {
+	IQuery<Integer> greatestNumberQuery = new ContextQuery<>() {
 		@Override
 		public Collector<Integer> perform(Iterator<Integer> iterator) {
 			Collector<Integer> result = new Collector<>();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ActionTest.java
index 462bcd1..1741c78 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ActionTest.java
@@ -242,7 +242,7 @@
 
 	public static Matcher<IPublisherResult> containsIU(final String id) {
 		final IQuery<IInstallableUnit> query = QueryUtil.createIUQuery(id);
-		return new TypeSafeMatcher<IPublisherResult>() {
+		return new TypeSafeMatcher<>() {
 
 			@Override
 			public void describeTo(Description description) {
@@ -259,7 +259,7 @@
 
 	public static Matcher<IPublisherResult> containsUniqueIU(final String id) {
 		final IQuery<IInstallableUnit> query = QueryUtil.createIUQuery(id);
-		return new TypeSafeMatcher<IPublisherResult>() {
+		return new TypeSafeMatcher<>() {
 
 			@Override
 			public void describeTo(Description description) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java
index 6d2ba82..21b4dd4 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java
@@ -17,13 +17,26 @@
 
 import static org.easymock.EasyMock.expect;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.IRequirement;
+import org.eclipse.equinox.p2.metadata.Version;
 import org.eclipse.equinox.p2.publisher.IPublisherResult;
-import org.eclipse.equinox.p2.publisher.actions.*;
+import org.eclipse.equinox.p2.publisher.actions.IAdditionalInstallableUnitAdvice;
+import org.eclipse.equinox.p2.publisher.actions.ICapabilityAdvice;
+import org.eclipse.equinox.p2.publisher.actions.ILicenseAdvice;
+import org.eclipse.equinox.p2.publisher.actions.IPropertyAdvice;
+import org.eclipse.equinox.p2.publisher.actions.IRootIUAdvice;
+import org.eclipse.equinox.p2.publisher.actions.ITouchpointAdvice;
+import org.eclipse.equinox.p2.publisher.actions.IUpdateDescriptorAdvice;
+import org.eclipse.equinox.p2.publisher.actions.IVersionAdvice;
+import org.eclipse.equinox.p2.publisher.actions.RootIUAction;
+import org.eclipse.equinox.p2.publisher.actions.RootIUAdvice;
+import org.eclipse.equinox.p2.publisher.actions.RootIUResultFilterAdvice;
 import org.eclipse.equinox.p2.query.IQuery;
 import org.eclipse.equinox.p2.query.MatchQuery;
 import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -233,7 +246,7 @@
 		IQuery<IInstallableUnit> query = null;
 		rootIUAdviceCollection = new ArrayList<>();
 		if ((testSpec & CONTAINS_A) > 0) {
-			query = new MatchQuery<IInstallableUnit>() {
+			query = new MatchQuery<>() {
 				@Override
 				public boolean isMatch(IInstallableUnit candidate) {
 					if (candidate.getId().equals(iu_A))
@@ -244,7 +257,7 @@
 			rootIUAdviceCollection.add(new RootIUResultFilterAdvice(query));
 		}
 		if ((testSpec & CONTAINS_B) > 0) {
-			query = new MatchQuery<IInstallableUnit>() {
+			query = new MatchQuery<>() {
 				@Override
 				public boolean isMatch(IInstallableUnit candidate) {
 					if (candidate.getId().equals(iu_B))
@@ -255,7 +268,7 @@
 			rootIUAdviceCollection.add(new RootIUResultFilterAdvice(query));
 		}
 		if ((testSpec & EMPTY) > 0) {
-			query = new MatchQuery<IInstallableUnit>() {
+			query = new MatchQuery<>() {
 				@Override
 				public boolean isMatch(IInstallableUnit candidate) {
 					return false;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/StatusMatchers.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/StatusMatchers.java
index e366134..ba885ed 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/StatusMatchers.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/StatusMatchers.java
@@ -14,12 +14,14 @@
 package org.eclipse.equinox.p2.tests.publisher.actions;
 
 import org.eclipse.core.runtime.IStatus;
-import org.hamcrest.*;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
 
 public class StatusMatchers {
 
 	public static Matcher<IStatus> errorStatus() {
-		return new TypeSafeMatcher<IStatus>() {
+		return new TypeSafeMatcher<>() {
 
 			@Override
 			public void describeTo(Description description) {
@@ -34,7 +36,7 @@
 	}
 
 	public static Matcher<IStatus> okStatus() {
-		return new TypeSafeMatcher<IStatus>() {
+		return new TypeSafeMatcher<>() {
 
 			@Override
 			public void describeTo(Description description) {
@@ -49,7 +51,7 @@
 	}
 
 	public static Matcher<IStatus> statusWithMessageWhich(final Matcher<String> messageMatcher) {
-		return new TypeSafeMatcher<IStatus>() {
+		return new TypeSafeMatcher<>() {
 
 			@Override
 			public void describeTo(Description description) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java
index 3713365..2f070ab 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java
@@ -58,7 +58,7 @@
 		IMetadataRepository repo = getMDR("/testData/galileoM7");
 
 		IQuery<IInstallableUnit> expressionQuery = QueryUtil.createMatchQuery("id ~= /com.ibm.*/");
-		IQuery<IInstallableUnit> matchQuery = new MatchQuery<IInstallableUnit>() {
+		IQuery<IInstallableUnit> matchQuery = new MatchQuery<>() {
 			@Override
 			public boolean isMatch(IInstallableUnit candidate) {
 				return candidate.getId().startsWith("com.ibm.");
@@ -93,7 +93,7 @@
 		IMetadataRepository repo = getMDR("/testData/galileoM7");
 
 		IQuery<IInstallableUnit> expressionQuery = QueryUtil.createMatchQuery("id == 'org.eclipse.core.resources'");
-		IQuery<IInstallableUnit> matchQuery = new MatchQuery<IInstallableUnit>() {
+		IQuery<IInstallableUnit> matchQuery = new MatchQuery<>() {
 			@Override
 			public boolean isMatch(IInstallableUnit candidate) {
 				return candidate.getId().equals("org.eclipse.core.resources");
@@ -128,7 +128,7 @@
 		IMetadataRepository repo = getMDR("/testData/galileoM7");
 
 		IQuery<IInstallableUnit> expressionQuery = QueryUtil.createMatchQuery("providedCapabilities.exists(x | x.namespace == 'org.eclipse.equinox.p2.iu' && x.name == 'org.eclipse.core.resources')");
-		IQuery<IInstallableUnit> matchQuery = new MatchQuery<IInstallableUnit>() {
+		IQuery<IInstallableUnit> matchQuery = new MatchQuery<>() {
 			@Override
 			public boolean isMatch(IInstallableUnit candidate) {
 				for (IProvidedCapability capability : candidate.getProvidedCapabilities())
@@ -165,7 +165,7 @@
 
 		IMetadataRepository repo = getMDR("/testData/galileoM7");
 
-		IQuery<IInstallableUnit> matchQuery = new MatchQuery<IInstallableUnit>() {
+		IQuery<IInstallableUnit> matchQuery = new MatchQuery<>() {
 			@Override
 			public boolean isMatch(IInstallableUnit candidate) {
 				return candidate.getId().startsWith("org.eclipse.");
@@ -180,7 +180,7 @@
 			long start = System.currentTimeMillis();
 			for (int idx = 0; idx < 80; ++idx) {
 				IQueryResult<IInstallableUnit> everything = repo.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());
-				Iterator<IInstallableUnit> matchIter = new MatchIteratorFilter<IInstallableUnit>(everything.iterator()) {
+				Iterator<IInstallableUnit> matchIter = new MatchIteratorFilter<>(everything.iterator()) {
 					@Override
 					protected boolean isMatch(IInstallableUnit candidate) {
 						return candidate.getId().startsWith("org.eclipse.");