diff --git a/src/main/java/org/apache/commons/lang3/tuple/ImmutableTriple.java b/src/main/java/org/apache/commons/lang3/tuple/ImmutableTriple.java index 4846cbef3..19042bd45 100644 --- a/src/main/java/org/apache/commons/lang3/tuple/ImmutableTriple.java +++ b/src/main/java/org/apache/commons/lang3/tuple/ImmutableTriple.java @@ -80,6 +80,7 @@ public final class ImmutableTriple extends Triple { * @return an immutable triple of nulls. * @since 3.6 */ + @SuppressWarnings("unchecked") public static ImmutableTriple nullTriple() { return NULL; } @@ -99,7 +100,7 @@ public final class ImmutableTriple extends Triple { * @return a triple formed from the three parameters, not null */ public static ImmutableTriple of(final L left, final M middle, final R right) { - return left != null | middle != null || right != null ? new ImmutableTriple<>(left, middle, right) : NULL; + return left != null | middle != null || right != null ? new ImmutableTriple<>(left, middle, right) : nullTriple(); } /**