SpanUniqueIdGenerator { public static String toOriginal(Span span) { String id = span.getId(); if (span.clientSpan()) { int suffixIndex = id.lastIndexOf(CLIENT_ID_SUFFIX); if (suffixIndex > 0) { id = id.substring(0, suffixIndex); } } return id; }  static String toUnique(Span span); static String toOriginal(Span span); static String getClientId(String id);  }
@Test public void testToOriginal() { String originalId = "064c292e02db027c22g"; Span span = new Span(null, clientAnnotations()); span.setId(originalId); span.setId(span.getId() + SpanUniqueIdGenerator.CLIENT_ID_SUFFIX); Assert.assertEquals(originalId, SpanUniqueIdGenerator.toOriginal(span)); }