@@ -265,7 +265,6 @@ public void testHashCode() throws Exception {
265265
266266 @ Test
267267 @ SuppressWarnings ("unchecked" )
268- @ JavaVersionRule .Enforce (17 )
269268 public void testEquals () throws Exception {
270269 AnnotationDescription identical = describe (first );
271270 assertThat (identical , is (identical ));
@@ -301,11 +300,14 @@ public Object answer(InvocationOnMock invocation) throws Throwable {
301300 AnnotationValue <?, ?> annotationValue = mock (AnnotationValue .class );
302301 when (annotationValue .resolve ()).thenReturn (null );
303302 when (equalFirstNameOnly .getValue (Mockito .any (MethodDescription .InDefinedShape .class ))).thenReturn ((AnnotationValue ) annotationValue );
304- assertThat (describe (first ), not (equalFirstNameOnly ));
305- assertThat (describe (first ), not (equalSecond ));
306- assertThat (describe (first ), not (new Object ()));
307- assertThat (describe (first ), not (equalTo (null )));
308- assertThat (describe (empty ), is (describe (empty )));
303+ // Very commonly buggy in intermediate releases.
304+ if (ClassFileVersion .ofThisVm ().isAtLeast (ClassFileVersion .JAVA_V17 ) || ClassFileVersion .ofThisVm ().equals (ClassFileVersion .JAVA_V8 )) {
305+ assertThat (describe (first ), not (equalFirstNameOnly ));
306+ assertThat (describe (first ), not (equalSecond ));
307+ assertThat (describe (first ), not (new Object ()));
308+ assertThat (describe (first ), not (equalTo (null )));
309+ assertThat (describe (empty ), is (describe (empty )));
310+ }
309311 }
310312
311313 @ Test (expected = IllegalArgumentException .class )
0 commit comments