Code example for ArrayDeque

0
        + "For more info see javadoc for Matchers class."; 
    assertThat(actual.getMessage()).isEqualTo(expected);
  } 
 
  @Test public void toStringFormat() { 
    Deque<StackTrace.Element> elements = new ArrayDeque<StackTrace.Element>();
 
    StackTrace onlyClass = new StackTrace("java.lang.NullPointerException", null, elements, null);
    assertThat(onlyClass.toString()).isEqualTo("java.lang.NullPointerException");
 
    StackTrace onlyMessage = new StackTrace(null, "Hello, World!", elements, null);
    assertThat(onlyMessage.toString()).isEqualTo("Hello, World!");
 
    StackTrace both = new StackTrace("java.lang.NullPointerException", "Hi, Mom!", elements, null);
    assertThat(both.toString()).isEqualTo("java.lang.NullPointerException: Hi, Mom!");
  } 
}