### Question:
Span implements io.opentracing.Span { static String stringToJSONValue(String value) { StringBuilder out = new StringBuilder(value.length() + 2); out.append("\""); for (int i = 0, length = value.length(); i < length; i++) { char c = value.charAt(i); switch (c) { case '"': case '\\': case '/': out.append('\\').append(c); break; case '\t': out.append("\\t"); break; case '\b': out.append("\\b"); break; case '\n': out.append("\\n"); break; case '\r': out.append("\\r"); break; case '\f': out.append("\\f"); break; default: if (c <= 0x1F) { out.append(String.format("\\u%04x", (int) c)); } else { out.append(c); } break; } } out.append("\""); return out.toString(); } Span(AbstractTracer tracer, SpanContext context, Builder grpcSpan, long startTimestampRelativeNanos); @Override SpanContext context(); @Override void finish(); @Override void finish(long finishTimeMicros); @Override Span setTag(String key, String value); @Override Span setTag(String key, boolean value); @Override Span setTag(String key, Number value); @Override Span setTag(io.opentracing.tag.Tag<T> tag, T value); @Override synchronized String getBaggageItem(String key); @Override synchronized Span setBaggageItem(String key, String value); synchronized Span setOperationName(String operationName); Span setComponentName(String componentName); @SuppressWarnings("WeakerAccess") void close(); AbstractTracer getTracer(); final Span log(Map<String, ?> fields); @Override final Span log(long timestampMicros, Map<String, ?> fields); @Override Span log(String message); @Override Span log(long timestampMicroseconds, String message); @SuppressWarnings("WeakerAccess") String generateTraceURL(); @SuppressWarnings("WeakerAccess") Builder getGrpcSpan();  }### Answer:
@Test public void testStringToJSONValue() { assertEquals("\"\\\"quoted\\\"\"", Span.stringToJSONValue("\"quoted\"")); assertEquals("\"\\\\back-slashed\\\\\"", Span.stringToJSONValue("\\back-slashed\\")); assertEquals("\"\\/fwd-slashed\\/\"", Span.stringToJSONValue("/fwd-slashed/")); assertEquals("\"\\ttabbed\"", Span.stringToJSONValue("\ttabbed")); assertEquals("\"\\bbackspace\"", Span.stringToJSONValue("\bbackspace")); assertEquals("\"\\nnewline\"", Span.stringToJSONValue("\nnewline")); assertEquals("\"\\rreturn\"", Span.stringToJSONValue("\rreturn")); assertEquals("\"\\ffeed\"", Span.stringToJSONValue("\ffeed")); }