@Test public void testGetFirstThrowableMatching() throws Exception { NullPointerException npe = new NullPointerException("simulated"); IllegalStateException ise = new IllegalStateException("simulated", npe); assertEquals(Exceptions.getFirstThrowableMatching(ise, Predicates.instanceOf(IllegalStateException.class)), ise); assertEquals(Exceptions.getFirstThrowableMatching(ise, Predicates.instanceOf(NullPointerException.class)), npe); assertNull(Exceptions.getFirstThrowableMatching(ise, Predicates.alwaysFalse())); }
public static Throwable getFirstThrowableMatching(Throwable from, Predicate<? super Throwable> filter) { return Iterables.tryFind(getCausalChain(from), filter).orNull(); }
Exceptions { public static Throwable getFirstThrowableMatching(Throwable from, Predicate<? super Throwable> filter) { return Iterables.tryFind(getCausalChain(from), filter).orNull(); } }
Exceptions { public static Throwable getFirstThrowableMatching(Throwable from, Predicate<? super Throwable> filter) { return Iterables.tryFind(getCausalChain(from), filter).orNull(); }  }
Exceptions { public static Throwable getFirstThrowableMatching(Throwable from, Predicate<? super Throwable> filter) { return Iterables.tryFind(getCausalChain(from), filter).orNull(); }  static boolean isPrefixBoring(Throwable t); static RuntimeException propagate(Throwable throwable); static RuntimeException propagate(String msg, Throwable throwable); static void propagateIfFatal(Throwable throwable); @SuppressWarnings("unchecked") static T getFirstThrowableOfType(Throwable from, Class<T> clazz); static Throwable getFirstThrowableMatching(Throwable from, Predicate<? super Throwable> filter); static Throwable getFirstInteresting(Throwable throwable); static Throwable collapse(Throwable source); static Throwable collapseIncludingAllCausalMessages(Throwable source); static Throwable collapse(Throwable source, boolean collapseCausalChain); static RuntimeException propagateCollapsed(Throwable source); static String collapseText(Throwable t); static String collapseTextIncludingAllCausalMessages(Throwable t); static RuntimeException propagate(Collection<? extends Throwable> exceptions); static RuntimeException propagate(String prefix, Collection<? extends Throwable> exceptions); static Throwable create(Collection<? extends Throwable> exceptions); static RuntimeException create(@Nullable String prefix, Collection<? extends Throwable> exceptions); static boolean isPrefixImportant(Throwable t); static String getPrefixText(Throwable t); }
Exceptions { public static Throwable getFirstThrowableMatching(Throwable from, Predicate<? super Throwable> filter) { return Iterables.tryFind(getCausalChain(from), filter).orNull(); }  static boolean isPrefixBoring(Throwable t); static RuntimeException propagate(Throwable throwable); static RuntimeException propagate(String msg, Throwable throwable); static void propagateIfFatal(Throwable throwable); @SuppressWarnings("unchecked") static T getFirstThrowableOfType(Throwable from, Class<T> clazz); static Throwable getFirstThrowableMatching(Throwable from, Predicate<? super Throwable> filter); static Throwable getFirstInteresting(Throwable throwable); static Throwable collapse(Throwable source); static Throwable collapseIncludingAllCausalMessages(Throwable source); static Throwable collapse(Throwable source, boolean collapseCausalChain); static RuntimeException propagateCollapsed(Throwable source); static String collapseText(Throwable t); static String collapseTextIncludingAllCausalMessages(Throwable t); static RuntimeException propagate(Collection<? extends Throwable> exceptions); static RuntimeException propagate(String prefix, Collection<? extends Throwable> exceptions); static Throwable create(Collection<? extends Throwable> exceptions); static RuntimeException create(@Nullable String prefix, Collection<? extends Throwable> exceptions); static boolean isPrefixImportant(Throwable t); static String getPrefixText(Throwable t);  }