HttpRequestTracingUtils { public static String getUserIdFromRequestWithHeaders(RequestWithHeaders request, List<String> userIdHeaderKeys) { if (request == null || userIdHeaderKeys == null || userIdHeaderKeys.isEmpty()) { return null; } for (String userIdHeaderKey : userIdHeaderKeys) { String userId = getHeaderWithAttributeAsBackup(request, userIdHeaderKey); if (userId != null && !userId.isEmpty()) { return userId; } } return null; } private  HttpRequestTracingUtils(); static Span fromRequestWithHeaders(RequestWithHeaders request, List<String> userIdHeaderKeys); static boolean hasInvalidSpanIdBecauseCallerDidNotSendOne(Span span); static boolean hasInvalidParentIdBecauseCallerDidNotSendSpanId(Span span); static String getUserIdFromRequestWithHeaders(RequestWithHeaders request, List<String> userIdHeaderKeys); static void propagateTracingHeaders(HttpObjectForPropagation httpObjectForPropagation, Span span); static String convertSampleableBooleanToExpectedB3Value(boolean sampleable); @SuppressWarnings("ConstantConditions") static @NotNull String generateSafeSpanName(
        @Nullable REQ request,
        @Nullable RES response,
        @NotNull HttpTagAndSpanNamingAdapter<REQ, RES> adapter
    ); static @NotNull String generateSafeSpanName(
        @Nullable String requestHttpMethod,
        @Nullable String pathTemplate,
        @Nullable Integer responseStatusCode
    ); static @NotNull String getFallbackSpanNameForHttpRequest(
        @Nullable String prefix,
        @Nullable String httpMethod
    ); static final String UNSPECIFIED_SPAN_NAME; static final String SPAN_FROM_HEADERS_WHERE_CALLER_DID_NOT_SEND_SPAN_ID_TAG_KEY; static final String CHILD_OF_SPAN_FROM_HEADERS_WHERE_CALLER_DID_NOT_SEND_SPAN_ID_TAG_KEY; }
@Test public void getUserIdFromRequestWithHeaders_returns_null_if_passed_null_request() { assertThat(HttpRequestTracingUtils.getUserIdFromRequestWithHeaders(null, USER_ID_HEADER_KEYS)).isNull(); }