diff --git a/lucene/core/src/test/org/apache/lucene/util/TestVersion.java b/lucene/core/src/test/org/apache/lucene/util/TestVersion.java index 2a62fca5e37..867caaf6e36 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestVersion.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestVersion.java @@ -37,8 +37,8 @@ public class TestVersion extends LuceneTestCase { Version values[] = Version.values(); // all but the latest version should be deprecated for (int i = 0; i < values.length-2; i++) { - assertTrue(values[i].name() + " should be deprecated", - Version.class.getField(values[i].name()).isAnnotationPresent(Deprecated.class)); + assertNotNull(values[i].name() + " should be deprecated", + Version.class.getField(values[i].name()).getAnnotation(Deprecated.class)); } } }