StackTraceUtils { public static StackTraceElement[] filter(StackTraceElement[] stackTrace, Class<?>... ignored) { return filter(stackTrace, Arrays.stream(ignored) .map(Class::getName) .toArray(String[]::new) ); } private  StackTraceUtils(); static StackTraceElement[] startsWith(StackTraceElement[] stackTrace, Predicate<StackTraceElement> condition); static StackTraceElement[] filter(StackTraceElement[] stackTrace, Class<?>... ignored); static StackTraceElement[] filter(StackTraceElement[] stacktrace, String... ignored);  }
@Test void filterClass() { StackTraceElement[] filtered = StackTraceUtils.filter(EXCEPTION.getStackTrace(), StackTraceUtilsTest.class); Assertions.assertFalse(ArrayUtils.findIn(filtered, element -> element.getClassName().equals(StackTraceUtilsTest.class.getName())).isPresent()); }
@Test void filterString() { StackTraceElement[] filtered = StackTraceUtils.filter(EXCEPTION.getStackTrace(), "org.panda_lang"); Assertions.assertFalse(ArrayUtils.findIn(filtered, element -> element.getClassName().contains("org.panda_lang")).isPresent()); }