@Test public void testCreationFromAnExisting() { CompositeException ce1 = new CompositeException(Arrays.asList(IAE, IO, OUPS)); Exception another = new Exception("another"); CompositeException ce2 = new CompositeException(ce1, another); assertThat(ce2.getCauses()).containsExactly(IAE, IO, OUPS, another); assertThat(ce2.getCause()).isEqualTo(IAE); }
public List<Throwable> getCauses() { List<Throwable> causes = new ArrayList<>(); causes.add(getCause()); causes.addAll(Arrays.asList(getSuppressed())); return causes; }
CompositeException extends RuntimeException { public List<Throwable> getCauses() { List<Throwable> causes = new ArrayList<>(); causes.add(getCause()); causes.addAll(Arrays.asList(getSuppressed())); return causes; } }
CompositeException extends RuntimeException { public List<Throwable> getCauses() { List<Throwable> causes = new ArrayList<>(); causes.add(getCause()); causes.addAll(Arrays.asList(getSuppressed())); return causes; } CompositeException(List<Throwable> causes);  CompositeException(Throwable... causes);  CompositeException(CompositeException other, Throwable toBeAppended); }
CompositeException extends RuntimeException { public List<Throwable> getCauses() { List<Throwable> causes = new ArrayList<>(); causes.add(getCause()); causes.addAll(Arrays.asList(getSuppressed())); return causes; } CompositeException(List<Throwable> causes);  CompositeException(Throwable... causes);  CompositeException(CompositeException other, Throwable toBeAppended); @Override String getMessage(); List<Throwable> getCauses(); }
CompositeException extends RuntimeException { public List<Throwable> getCauses() { List<Throwable> causes = new ArrayList<>(); causes.add(getCause()); causes.addAll(Arrays.asList(getSuppressed())); return causes; } CompositeException(List<Throwable> causes);  CompositeException(Throwable... causes);  CompositeException(CompositeException other, Throwable toBeAppended); @Override String getMessage(); List<Throwable> getCauses();  }