#vulnerable code 
                              @Test
  public void shouldCreateFeaturedPlaylistsRequest() {
    final String accessToken = "myAccessToken";

    final Api api = Api.builder()
        .accessToken(accessToken)
        .build();


    Calendar calendar = Calendar.getInstance();
    calendar.set(2014, 11, 22, 13, 59, 30);
    Date timestamp = calendar.getTime();

    final Request request = api
        .getFeaturedPlaylists()
        .country("SE")
        .locale("es_MX")
        .limit(5)
        .offset(1)
        .timestamp(timestamp)
        .build();

    DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");

    assertEquals("https://api.spotify.com:443/v1/browse/featured-playlists", request.toString());
    assertHasHeader(request.toUrl(), "Authorization", "Bearer " + accessToken);
    assertHasParameter(request.toUrl(), "limit", "5");
    assertHasParameter(request.toUrl(), "offset", "1");
    assertHasParameter(request.toUrl(), "country", "SE");
    assertHasParameter(request.toUrl(), "locale", "es_MX");
    assertHasParameter(request.toUrl(), "timestamp", format.format(timestamp));
  } 
                            #location 7 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              @Test
  public void shouldCreateFeaturedPlaylistsRequest() {
    final String accessToken = "myAccessToken";

    final Api api = Api.builder()
        .accessToken(accessToken)
        .build();


    Calendar calendar = Calendar.getInstance();
    calendar.set(2014, Calendar.DECEMBER, 22, 13, 59, 30);
    Date timestamp = calendar.getTime();

    final Request request = api
        .getFeaturedPlaylists()
        .country("SE")
        .locale("es_MX")
        .limit(5)
        .offset(1)
        .timestamp(timestamp)
        .build();

    DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");

    assertEquals("https://api.spotify.com:443/v1/browse/featured-playlists", request.toString());
    assertHasHeader(request.toUrl(), "Authorization", "Bearer " + accessToken);
    assertHasParameter(request.toUrl(), "limit", "5");
    assertHasParameter(request.toUrl(), "offset", "1");
    assertHasParameter(request.toUrl(), "country", "SE");
    assertHasParameter(request.toUrl(), "locale", "es_MX");
    assertHasParameter(request.toUrl(), "timestamp", format.format(timestamp));
  }