diff --git a/src/test/java/org/junit/rules/ErrorCollectorTest.java b/src/test/java/org/junit/rules/ErrorCollectorTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/junit/rules/ErrorCollectorTest.java
+++ b/src/test/java/org/junit/rules/ErrorCollectorTest.java
@@ -1,6 +1,7 @@
 package org.junit.rules;
 
 import org.hamcrest.Matcher;
+import org.hamcrest.Matchers;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.function.ThrowingRunnable;
@@ -45,12 +46,12 @@ public class ErrorCollectorTest {
                         everyTestRunSuccessful()},
                 {
                     CheckMatcherThatFailsWithoutProvidedReason.class,
-                        hasSingleFailureWithMessage(allOf(
+                        hasSingleFailureWithMessage(Matchers.<String>allOf(
                             containsString("Expected: is <4>"),
                             containsString("but: was <3>")))},
                 {
                     CheckMatcherThatFailsWithProvidedReason.class,
-                        hasSingleFailureWithMessage(allOf(
+                        hasSingleFailureWithMessage(Matchers.<String>allOf(
                             containsString("reason"),
                             containsString("Expected: is <4>"),
                             containsString("but: was <3>")))},
Add explicit type parameters for JDK 5

The code did not compile with JDK 5 before.