/** Returns the SpanTree this belongs to and throws a nice NullPointerException if none */ private SpanTree getNonNullSpanTree() { SpanTree spanTree=getSpanTree(); if (spanTree==null) throw new NullPointerException(this + " is not attached to a SpanTree through its parent yet"); return spanTree; }