@Test
public void getCauses_reversed() {

    // 3 exceptions, reversed
    List<Throwable> es = ExceptionUtil.getCauses(getException(), true);
    assertEquals(3, es.size());
    Iterator<Throwable> i = es.iterator();
    assertThat(i.next(), instanceOf(IllegalStateException.class));
    assertThat(i.next(), instanceOf(IllegalArgumentException.class));
    assertThat(i.next(), instanceOf(IOException.class));
}