From 0d0828fb7bcd98ce4bcb47af5e71b766c95bb771 Mon Sep 17 00:00:00 2001 From: Sven Haag Date: Mon, 29 Jul 2024 14:13:16 +0200 Subject: [PATCH] Ensure no exception is thrown when getting builder hashCode. --- .../java/de/cuioss/tools/collect/CollectionBuilderTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/java/de/cuioss/tools/collect/CollectionBuilderTest.java b/src/test/java/de/cuioss/tools/collect/CollectionBuilderTest.java index ec87617..4e5e7f8 100644 --- a/src/test/java/de/cuioss/tools/collect/CollectionBuilderTest.java +++ b/src/test/java/de/cuioss/tools/collect/CollectionBuilderTest.java @@ -18,6 +18,7 @@ import static de.cuioss.tools.collect.CollectionLiterals.immutableList; import static de.cuioss.tools.collect.CollectionLiterals.mutableList; import static de.cuioss.tools.collect.CollectionLiterals.mutableSortedSet; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -108,6 +109,7 @@ void shouldHandleObjectMethods() { builder.add("1"); assertNotNull(builder.toString()); + assertDoesNotThrow(builder::hashCode); assertNotEquals(0, builder.hashCode()); assertEquals(builder, builder); }