### Question:
StackTrace extends ModelObject { public @CheckForNull StackTraceElement getElement(@Nonnegative int depth) { if (depth < 0) throw new ArrayIndexOutOfBoundsException(depth); return elements.length > depth ? elements[depth] : null ; } StackTrace(@Nonnull StackTraceElement... elements);  StackTrace(@Nonnull List<StackTraceElement> elements); static StackTraceElement element(String declaringClass, String methodName, String fileName, int lineNumber); static StackTraceElement element(String declaringClass, String methodName, String fileName); static StackTraceElement element(String declaringClass, String methodName); static StackTraceElement nativeElement(String declaringClass, String methodName); static StackTraceElement nativeElement(String declaringClass, String methodName, String fileName); int size(); @CheckForNull StackTraceElement getElement(@Nonnegative int depth); @CheckForNull StackTraceElement getHead(); @CheckForNull StackTraceElement head(); @Nonnull List<StackTraceElement> getElements(); @Override void toString(PrintStream stream, Mode mode); @Override int hashCode(); @Override boolean equals(Object rhs);  }### Answer:
@Test(expected = ArrayIndexOutOfBoundsException.class) public void negativeStackTraceElement() { new StackTrace(ELEMENT).getElement(-1); }
@Test public void nonexistentStackTraceElement() { assertThat(new StackTrace().getElement(0), nullValue()); }