SpanId implements Comparable<SpanId> { public boolean isValid() { return (high != 0) || (low != 0); } SpanId(long high, long low); static SpanId fromRandom(); static SpanId fromString(String str); long getHigh(); long getLow(); @Override boolean equals(Object o); @Override int compareTo(SpanId other); @Override int hashCode(); @Override String toString(); boolean isValid(); SpanId newChildId(); static SpanId INVALID; }
@Test public void testValidAndInvalidIds() throws Exception { Assert.assertFalse(SpanId.INVALID.isValid()); Assert.assertTrue( new SpanId(0x1234567812345678L, 0x1234567812345678L).isValid()); Assert.assertTrue( new SpanId(0xf234567812345678L, 0xf234567812345678L).isValid()); }