TraceId { public boolean isValid() { return (traceId.signum() > 0) && (traceId.bitLength() <= TRACE_ID_BIT_LENGTH); } TraceId(BigInteger traceId); static TraceId invalid(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); boolean isValid(); BigInteger getTraceId(); String getApiString();  }
@Test public void testIsValid() { assertThat(first.isValid()).isTrue(); assertThat(zero.isValid()).isFalse(); assertThat(negative.isValid()).isFalse(); assertThat(tooLarge.isValid()).isFalse(); }