@Test public void canOverrideEverything() { Span clientSide = Span.builder().traceId(10L).id(10L).name("") .addAnnotation(Annotation.create((TODAY + 50) * 1000, CLIENT_SEND, WEB_ENDPOINT)) .addAnnotation(Annotation.create((TODAY + 300) * 1000, CLIENT_RECV, WEB_ENDPOINT)) .build(); Span serverSide = Span.builder().traceId(10L).id(10L).name("get") .addAnnotation(Annotation.create((TODAY + 100) * 1000, SERVER_RECV, APP_ENDPOINT)) .addAnnotation(Annotation.create((TODAY + 250) * 1000, SERVER_SEND, APP_ENDPOINT)) .build(); Adjuster adjuster = new Adjuster() { @Override public Iterable<Span> adjust(Iterable<Span> trace) { return MergeById.apply(Lists.newArrayList(trace)); } }; assertThat(adjuster.adjust(asList(clientSide, serverSide))) .containsExactlyElementsOf(MergeById.apply(asList(clientSide, serverSide))); }
public Iterable<Span> adjust(final Iterable<Span> trace) { if (trace == null) throw new NullPointerException("trace was null"); return () -> new AdjustingIterator(this, trace.iterator()); }
Adjuster implements Serializable { public Iterable<Span> adjust(final Iterable<Span> trace) { if (trace == null) throw new NullPointerException("trace was null"); return () -> new AdjustingIterator(this, trace.iterator()); } }
Adjuster implements Serializable { public Iterable<Span> adjust(final Iterable<Span> trace) { if (trace == null) throw new NullPointerException("trace was null"); return () -> new AdjustingIterator(this, trace.iterator()); }  }
Adjuster implements Serializable { public Iterable<Span> adjust(final Iterable<Span> trace) { if (trace == null) throw new NullPointerException("trace was null"); return () -> new AdjustingIterator(this, trace.iterator()); }  Iterable<Span> adjust(final Iterable<Span> trace); }
Adjuster implements Serializable { public Iterable<Span> adjust(final Iterable<Span> trace) { if (trace == null) throw new NullPointerException("trace was null"); return () -> new AdjustingIterator(this, trace.iterator()); }  Iterable<Span> adjust(final Iterable<Span> trace);  }