static void cleanStackTrace(Throwable throwable) {
    new StackTraceCleaner(throwable).clean(Sets.<Throwable>newIdentityHashSet());
  }
@Test
  public void packagesAreIgnoredForTestClasses() {
    Throwable throwable =
        createThrowableWithStackTrace(
            "com.google.testing.util.ShouldStrip1",
            "com.google.testing.util.ShouldStrip2",
            "com.google.testing.util.ShouldNotStripTest");

    StackTraceCleaner.cleanStackTrace(throwable);

    assertThat(throwable.getStackTrace())
        .isEqualTo(
            new StackTraceElement[] {
              createCollapsedStackTraceElement("Testing framework", 2),
              createStackTraceElement("com.google.testing.util.ShouldNotStripTest"),
            });
  }