@Test
public void testNewInstance() throws URISyntaxException {

    LOG.info("testNewInstance");
    when(httpServletRequest.getHeader(HEADER_NAME_X_HTTPS)).thenReturn(HEADER_VALUE_X_HTTPS_TRUE);
    when(httpServletRequest.getHeader(HEADER_NAME_X_FORWARDED_HOST)).thenReturn(HEADER_VALUE_X_FORWARDED_HOST);
    when(httpServletRequest.getHeader(HEADER_NAME_X_ORIGINAL_URI)).thenReturn(HEADER_VALUE_X_ORIGINAL_URI);
    when(uriInfo.getRequestUri()).thenReturn(internalUri);
    final UriBuilder uriBuilder = impl.newInstance();
    assertThat(uriBuilder, is(notNullValue()));
    final URI uri = uriBuilder.build();
    assertThat(uri, is(notNullValue()));
    assertThat(uri, is(referenceExternalBaseUri));
}