@Test public void composite() { Throwable foo = new Exception("foo"); Throwable bar = new Exception("bar"); try { throw Throwables2.composite(new Exception("test"), foo, bar); } catch (Exception e) { assertThat(e.getSuppressed(), arrayWithSize(2)); assertThat(e.getSuppressed()[0], is(foo)); assertThat(e.getSuppressed()[1], is(bar)); } }
public static <T extends Throwable> T composite(final T root, final Throwable... suppressed) throws T { checkNotNull(suppressed); for (Throwable t : suppressed) { root.addSuppressed(t); } throw root; }
Throwables2 { public static <T extends Throwable> T composite(final T root, final Throwable... suppressed) throws T { checkNotNull(suppressed); for (Throwable t : suppressed) { root.addSuppressed(t); } throw root; } }
Throwables2 { public static <T extends Throwable> T composite(final T root, final Throwable... suppressed) throws T { checkNotNull(suppressed); for (Throwable t : suppressed) { root.addSuppressed(t); } throw root; }  }
Throwables2 { public static <T extends Throwable> T composite(final T root, final Throwable... suppressed) throws T { checkNotNull(suppressed); for (Throwable t : suppressed) { root.addSuppressed(t); } throw root; }  static String explain(final Throwable throwable); static T composite(final T root, final Throwable... suppressed); static T composite(final T root, final Collection<? extends Throwable> suppressed); }
Throwables2 { public static <T extends Throwable> T composite(final T root, final Throwable... suppressed) throws T { checkNotNull(suppressed); for (Throwable t : suppressed) { root.addSuppressed(t); } throw root; }  static String explain(final Throwable throwable); static T composite(final T root, final Throwable... suppressed); static T composite(final T root, final Collection<? extends Throwable> suppressed);  }