Span implements Serializable { public boolean serverSpan() { boolean srPresent = false; boolean ssPresent = false; for (int i = 0; i < annotations.size(); i++) { if (annotations.get(i).getValue().equals("sr")) { srPresent = true; } else if (annotations.get(i).getValue().equals("ss")) { ssPresent = true; } if (srPresent && ssPresent) { break; } } return srPresent && ssPresent; } Span(); @JsonCreator  Span(@JsonProperty("binaryAnnotations") List<BinaryAnnotation> binaryAnnotations,
                @JsonProperty("annotations") List<Annotation> annotations);  Span(Span span, List<BinaryAnnotation> binaryAnnotations, List<Annotation> annotations); String getTraceId(); void setTraceId(String traceId); String getName(); void setName(String name); String getId(); void setId(String id); String getParentId(); void setParentId(String parentId); List<Annotation> getAnnotations(); List<BinaryAnnotation> getBinaryAnnotations(); Boolean getDebug(); void setDebug(Boolean debug); Long getTimestamp(); void setTimestamp(Long timestamp); Long getDuration(); void setDuration(Long duration); boolean topLevelSpan(); boolean clientSpan(); boolean serverSpan(); BinaryAnnotation getBinaryAnnotation(String key); MappingResult binaryAnnotationMapping(); String ipv4(); String service(); URL url(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testIsServerSpan() { Annotation sr = new Annotation(); sr.setValue("sr"); Annotation ss = new Annotation(); ss.setValue("ss"); Span span = new Span(null, Arrays.asList(sr, ss)); Assert.assertTrue(span.serverSpan()); span = new Span(null, Arrays.asList(ss, sr)); Assert.assertTrue(span.serverSpan()); span = new Span(null, null); Assert.assertFalse(span.serverSpan()); span = new Span(null, Arrays.asList(ss)); Assert.assertFalse(span.serverSpan()); Annotation cr = new Annotation(); cr.setValue("cr"); Annotation cs = new Annotation(); cs.setValue("cs"); span = new Span(null, Arrays.asList(cr, cs, ss , sr)); Assert.assertTrue(span.serverSpan()); }