### Question:
ControllerUtils { static URL getRequestRoot( final HttpServletRequest request, @Nullable final String path ) throws MalformedURLException { return getRequestRoot(new URL(request.getRequestURL().toString()), path); } private  ControllerUtils(); static String getRemainingPath(final HttpServletRequest request);  }### Answer:
@Test void canGetRequestRoot() throws MalformedURLException { final HttpServletRequest request = Mockito.mock(HttpServletRequest.class); final URL requestURL = new URL("https: final StringBuffer buffer = new StringBuffer(requestURL.toString()); Mockito.when(request.getRequestURL()).thenReturn(buffer); Assertions .assertThat(ControllerUtils.getRequestRoot(request, "")) .isEqualTo(new URL("https: Assertions .assertThat(ControllerUtils.getRequestRoot(request, null)) .isEqualTo(new URL("https: Assertions .assertThat(ControllerUtils.getRequestRoot(request, UUID.randomUUID().toString())) .isEqualTo(new URL("https: Assertions .assertThat(ControllerUtils.getRequestRoot(request, ".done")) .isEqualTo(new URL("https: Assertions .assertThat(ControllerUtils.getRequestRoot(request, "genie/genie.done")) .isEqualTo(new URL("https: }