Skip to content

Commit

Permalink
Add test for ExportBufferManager
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenreichardt committed Oct 9, 2024
1 parent 170afaf commit 2c70135
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -95,6 +96,13 @@ public static <E extends Exception> void closeAll(
closeAll(handler, Arrays.asList(closeables));
}

public static <E extends Exception> void closeAll(
CheckedConsumer<Exception, E> handler,
Stream<AutoCloseable> closeables
) throws E {
closeAll(handler, closeables.iterator());
}

public static <E extends Exception> void closeAll(
CheckedConsumer<Exception, E> handler,
Iterable<? extends AutoCloseable> closeables
Expand Down

0 comments on commit 2c70135

Please sign in to comment.