From 2c7013583ba98d9497edf1fb74a5825b50048630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Reichardt?= Date: Tue, 8 Oct 2024 17:50:42 +0200 Subject: [PATCH] Add test for ExportBufferManager --- .../src/main/java/org/neo4j/gds/utils/ExceptionUtil.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core-utils/src/main/java/org/neo4j/gds/utils/ExceptionUtil.java b/core-utils/src/main/java/org/neo4j/gds/utils/ExceptionUtil.java index 494cd70c4e..55326effab 100644 --- a/core-utils/src/main/java/org/neo4j/gds/utils/ExceptionUtil.java +++ b/core-utils/src/main/java/org/neo4j/gds/utils/ExceptionUtil.java @@ -31,6 +31,7 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; +import java.util.stream.Stream; public final class ExceptionUtil { @@ -95,6 +96,13 @@ public static void closeAll( closeAll(handler, Arrays.asList(closeables)); } + public static void closeAll( + CheckedConsumer handler, + Stream closeables + ) throws E { + closeAll(handler, closeables.iterator()); + } + public static void closeAll( CheckedConsumer handler, Iterable closeables