public static List<String> getErrorMessages(final Throwable e) {
    return getThrowables(e).stream()
        .map(ErrorMessageUtil::getErrorMessage)
        .collect(Collectors.toList());
  }
@Test
  public void shouldBuildErrorMessageChain() {
    // Given:
    final Throwable e = new Exception("root", new Exception("cause"));

    // Then:
    assertThat(getErrorMessages(e), equalTo(ImmutableList.of("root", "cause")));
  }