public JwtRecord convertJwtToJwtRecord(Jwt jwt) {
        return new JwtRecord(
                jwt.getTokenValue(),
                jwt.getHeaders(),
                jwt.getClaims(),
                jwt.getIssuedAt(),
                jwt.getExpiresAt(),
                jwt.getClaimAsString("sub"),
                jwt.getClaimAsString("iss"),
                jwt.getAudience().toString()
        );
    }
@Test
    void givenJwt_whenConvertJwtToJwtRecord_thenCorrectlyConverted() {

        // Given
        Map<String, Object> claims = new HashMap<>();
        claims.put("sub", "user123");
        claims.put("iss", "issuer");
        claims.put("aud", "audience");

        Jwt jwt = Jwt.withTokenValue("tokenValue")
                .header("alg", "RS256")
                .header("typ", "JWT")
                .claims(claimsConsumer -> claimsConsumer.putAll(claims)) // Corrected claim setting
                .issuedAt(Instant.now())
                .expiresAt(Instant.now().plusSeconds(3600))
                .build();

        // When
        JwtRecord jwtRecord = JwtRecordConverter.convertJwtToJwtRecord(jwt);

        // Then
        assertThat(jwtRecord).isNotNull();
        assertThat(jwtRecord.tokenValue()).isEqualTo("tokenValue");
        assertThat(jwtRecord.headers()).isEqualTo(jwt.getHeaders());
        assertThat(jwtRecord.claims()).isEqualTo(jwt.getClaims());
        assertThat(jwtRecord.issuedAt()).isEqualTo(jwt.getIssuedAt());
        assertThat(jwtRecord.expiresAt()).isEqualTo(jwt.getExpiresAt());
        assertThat(jwtRecord.subject()).isEqualTo("user123");
        assertThat(jwtRecord.issuer()).isEqualTo("issuer");
        assertThat(jwtRecord.audience()).isEqualTo("[audience]");

    }