@Test
public void testCausedByMatcher() {

  String[] validCauses = new String[] {
    "Caused by: java.lang.RuntimeException",
    "    Caused by: java.io.IOException",
    "\tCaused by: java.lang.IllegalArgumentException"
  };
  for (String cause: validCauses) {
    assertThat(StackTraceExpander.getCauseLine(cause)).isEqualTo(cause.trim());
  }
  String[] invalidCauses = new String[] {
    "at com.example.t1.MainActivity.one(MainActivity.java:31)",
    "... 15 more"
  };
  for (String cause: invalidCauses) {
    Assert.assertNull(StackTraceExpander.getCauseLine(cause));
  }
}