public static Optional<UserAgent> getUserAgent() {
    return Optional.ofNullable(USER_AGENT_CONTEXT_KEY.get());
  }
@Test
  void getUserAgent() throws UnrecognizedUserAgentException {
    when(clientConnectionManager.getUserAgent(any()))
        .thenReturn(Optional.empty());

    assertFalse(getRequestAttributes().hasUserAgent());

    final UserAgent userAgent = UserAgentUtil.parseUserAgentString("Signal-Desktop/1.2.3 Linux");

    when(clientConnectionManager.getUserAgent(any()))
        .thenReturn(Optional.of(userAgent));

    final GetRequestAttributesResponse response = getRequestAttributes();
    assertTrue(response.hasUserAgent());
    assertEquals("DESKTOP", response.getUserAgent().getPlatform());
    assertEquals("1.2.3", response.getUserAgent().getVersion());
    assertEquals("Linux", response.getUserAgent().getAdditionalSpecifiers());
  }