### Question:
SpanContext { @Memoized public boolean isValid() { return TraceId.isValid(getTraceIdHex()) && SpanId.isValid(getSpanIdHex()); }  static SpanContext getInvalid(); static SpanContext create(
      String traceIdHex, String spanIdHex, byte traceFlags, TraceState traceState); static SpanContext createFromRemoteParent(
      String traceIdHex, String spanIdHex, byte traceFlags, TraceState traceState); String getTraceIdAsHexString(); @Memoized byte[] getTraceIdBytes(); String getSpanIdAsHexString(); @Memoized byte[] getSpanIdBytes(); boolean isSampled(); abstract byte getTraceFlags(); void copyTraceFlagsHexTo(char[] dest, int destOffset); abstract TraceState getTraceState(); @Memoized boolean isValid(); abstract boolean isRemote();  }### Answer:
@Test void isValid() { assertThat(SpanContext.getInvalid().isValid()).isFalse(); assertThat( SpanContext.create( FIRST_TRACE_ID, SpanId.getInvalid(), TraceFlags.getDefault(), EMPTY_TRACE_STATE) .isValid()) .isFalse(); assertThat( SpanContext.create( TraceId.getInvalid(), FIRST_SPAN_ID, TraceFlags.getDefault(), EMPTY_TRACE_STATE) .isValid()) .isFalse(); assertThat(first.isValid()).isTrue(); assertThat(second.isValid()).isTrue(); }