@Test
public void shouldNotResolveFirstServletMappingWhenNoMatchingElements() {

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