### Question:
HttpServerTracer extends BaseTracer { static String extractForwardedFor(String forwarded) { int start = forwarded.toLowerCase().indexOf("for="); if (start < 0) { return null; } start += 4; if (start >= forwarded.length() - 1) { return null; } for (int i = start; i < forwarded.length() - 1; i++) { char c = forwarded.charAt(i); if (c == ',' || c == ';') { if (i == start) { return null; } return forwarded.substring(start, i); } } return forwarded.substring(start); } HttpServerTracer();  HttpServerTracer(Tracer tracer); Span startSpan(REQUEST request, CONNECTION connection, Method origin); Span startSpan(REQUEST request, CONNECTION connection, String spanName); Span startSpan(
      REQUEST request, CONNECTION connection, String spanName, long startTimestamp); Scope startScope(Span span, STORAGE storage); void end(Span span, RESPONSE response); void end(Span span, RESPONSE response, long timestamp); @Override void endExceptionally(Span span, Throwable throwable); void endExceptionally(Span span, Throwable throwable, RESPONSE response); void endExceptionally(Span span, Throwable throwable, RESPONSE response, long timestamp); Span getServerSpan(STORAGE storage); @Nullable abstract Context getServerContext(STORAGE storage); static final String CONTEXT_ATTRIBUTE; }### Answer:
@Test public void extractForwardedForMalformed() { assertNull(HttpServerTracer.extractForwardedFor("for=;for=1.1.1.1")); }
@Test public void extractForwardedForEmpty() { assertNull(HttpServerTracer.extractForwardedFor("")); }
@Test public void extractForwardedForEmptyValue() { assertNull(HttpServerTracer.extractForwardedFor("for=")); }
@Test public void extractForwardedForEmptyValueWithSemicolon() { assertNull(HttpServerTracer.extractForwardedFor("for=;")); }
@Test public void extractForwardedForNoFor() { assertNull(HttpServerTracer.extractForwardedFor("by=1.1.1.1;test=1.1.1.1")); }
@Test public void extractForwardedForMultiple() { assertEquals("1.1.1.1", HttpServerTracer.extractForwardedFor("for=1.1.1.1;for=1.2.3.4")); }
@Test public void extractForwardedForMixedSplitter() { assertEquals( "1.1.1.1", HttpServerTracer.extractForwardedFor("test=abcd; by=1.2.3.4, for=1.1.1.1;for=1.2.3.4")); }
@Test public void extractForwardedFor() { assertEquals("1.1.1.1", HttpServerTracer.extractForwardedFor("for=1.1.1.1")); }
@Test public void extractForwardedForCaps() { assertEquals("1.1.1.1", HttpServerTracer.extractForwardedFor("For=1.1.1.1")); }