@Test
public void shouldResolveFirstServlet() {

    ServletMapping servletMapping1 = new ServletMappingImpl(Pattern.compile("^/somepath.*$"), SampleServlet.class);
    ServletMapping servletMapping2 = new ServletMappingImpl(Pattern.compile("^/some.*$"), SampleServlet.class);
    when(servletContext.getServletMappings()).thenReturn(Arrays.asList(servletMapping1, servletMapping2));
    assertThat(servletContextHelper.getResolvedServletMapping(servletContext, "/context/somepathX"),
            is(servletMapping1));
}