From 78cd79b221ad92ba051d812bd807d5f7a2fc990f Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Wed, 29 May 2024 11:07:06 +0200 Subject: [PATCH] Add test for ofNullable --- .../opentripplanner/framework/collection/ListUtilsTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/opentripplanner/framework/collection/ListUtilsTest.java b/src/test/java/org/opentripplanner/framework/collection/ListUtilsTest.java index 6e72d5626c5..33dce1f5574 100644 --- a/src/test/java/org/opentripplanner/framework/collection/ListUtilsTest.java +++ b/src/test/java/org/opentripplanner/framework/collection/ListUtilsTest.java @@ -56,5 +56,11 @@ void distinctByKey() { assertEquals(List.of(first, third), deduplicated); } + @Test + void ofNullable() { + assertEquals(List.of(), ListUtils.ofNullable(null)); + assertEquals(List.of("A"), ListUtils.ofNullable("A")); + } + private record Wrapper(int i, String string) {} }