ExceptionUtil { public static Throwable peel(@Nullable Throwable t) { while ((t instanceof CompletionException || t instanceof ExecutionException || t instanceof InvocationTargetException) && t.getCause() != null && t.getCause() != t ) { t = t.getCause(); } return t; } private  ExceptionUtil(); static boolean isRestartableException(Throwable t); @SuppressWarnings("checkstyle:booleanexpressioncomplexity") static boolean isTopologyException(Throwable t); static void registerJetExceptions(@Nonnull ClientExceptions factory); static void registerJetExceptions(@Nonnull ClientExceptionFactory factory); static Throwable peel(@Nullable Throwable t); @Nonnull static RuntimeException rethrow(@Nonnull final Throwable t); @Nonnull static BiConsumer<T, ? super Throwable> withTryCatch(
            @Nonnull ILogger logger, @Nonnull BiConsumer<T, ? super Throwable> consumer
    ); @Nonnull static BiConsumer<T, ? super Throwable> withTryCatch(
            @Nonnull ILogger logger, @Nonnull String message, @Nonnull BiConsumer<T, ? super Throwable> consumer
    ); @SuppressWarnings("unchecked") @Nonnull static RuntimeException sneakyThrow(@Nonnull Throwable t); @Nonnull static String stackTraceToString(Throwable t); static RuntimeException handleSerializedLambdaCce(HazelcastSerializationException e);  }
@Test public void when_throwableIsRuntimeException_then_peelReturnsOriginal() { Throwable throwable = new RuntimeException("expected exception"); Throwable result = peel(throwable); assertEquals(throwable, result); }
@Test public void when_throwableIsExecutionException_then_peelReturnsCause() { Throwable throwable = new RuntimeException("expected exception"); Throwable result = peel(new ExecutionException(throwable)); assertEquals(throwable, result); }