Route first = mock(Route.class);
when(first.getControllerMethod()).thenReturn(anyControllerMethod());
Route second = mock(Route.class);
when(second.getControllerMethod()).thenReturn(anyControllerMethod());
ControllerMethod method2 = second.controllerMethod(request, "second");
router.add(second);
router.add(first);
when(first.getPriority()).thenReturn(Path.HIGH);
when(second.getPriority()).thenReturn(Path.LOW);
EnumSet<HttpMethod> get = EnumSet.of(HttpMethod.GET);
when(first.allowedMethods()).thenReturn(get);
when(second.allowedMethods()).thenReturn(get);
when(first.canHandle(anyString())).thenReturn(false);
when(second.canHandle(anyString())).thenReturn(true);
ControllerMethod found = router.parse("anything", HttpMethod.GET, request);
assertThat(found, is(method2));
}