RegistryEndpointProvider<URL> writer(URL location, Consumer<Long> writtenByteCountListener) {
    return new Writer(location, writtenByteCountListener);
  }
@Test
  public void testWriter_handleResponse() throws IOException, RegistryException {
    Mockito.when(mockResponse.getHeader("Location"))
        .thenReturn(Collections.singletonList("https://somenewurl/location"));
    GenericUrl requestUrl = new GenericUrl("https://someurl");
    Mockito.when(mockResponse.getRequestUrl()).thenReturn(requestUrl);
    Assert.assertEquals(
        new URL("https://somenewurl/location"),
        testBlobPusher.writer(mockUrl, ignored -> {}).handleResponse(mockResponse));
  }