BlockJUnit4ClassRunnerWithParameters extends
        BlockJUnit4ClassRunner { @Override protected Annotation[] getRunnerAnnotations() { Annotation[] allAnnotations = super.getRunnerAnnotations(); Annotation[] annotationsWithoutRunWith = new Annotation[allAnnotations.length - 1]; int i = 0; for (Annotation annotation: allAnnotations) { if (!annotation.annotationType().equals(RunWith.class)) { annotationsWithoutRunWith[i] = annotation; ++i; } } return annotationsWithoutRunWith; } BlockJUnit4ClassRunnerWithParameters(TestWithParameters test); @Override Object createTest();  }
@Test public void hasAllAnnotationsExceptRunWith() throws Exception { TestWithParameters testWithParameters = new TestWithParameters( "dummy name", new TestClass( ClassWithParameterizedAnnotation.class), NO_PARAMETERS); BlockJUnit4ClassRunnerWithParameters runner = new BlockJUnit4ClassRunnerWithParameters( testWithParameters); Annotation[] annotations = runner.getRunnerAnnotations(); assertEquals(1, annotations.length); assertEquals(annotations[0].annotationType(), DummyAnnotation.class); }