From 7e152d493534617ee7e76ae2b587243102a7be84 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 23 Jun 2024 14:18:47 -0400 Subject: [PATCH] Use if-else --- .../commons/collections4/map/AbstractOrderedMapTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/apache/commons/collections4/map/AbstractOrderedMapTest.java b/src/test/java/org/apache/commons/collections4/map/AbstractOrderedMapTest.java index 62bc5346c..9caf0c4fc 100644 --- a/src/test/java/org/apache/commons/collections4/map/AbstractOrderedMapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/AbstractOrderedMapTest.java @@ -240,10 +240,8 @@ public abstract class AbstractOrderedMapTest extends AbstractIterableMapTe if (!isAllowNullKey()) { final OrderedMap finalOrdered = ordered; assertThrows(NullPointerException.class, () -> finalOrdered.previousKey(null)); - } else { - if (!isAllowNullKey()) { - assertNull(ordered.previousKey(null)); - } + } else if (!isAllowNullKey()) { + assertNull(ordered.previousKey(null)); } }