@Test
public void shouldReturnCloserMatchBinding() throws Exception {

    ExceptionHandlerBinding illegalStateBinding = ExceptionHandlerBinding.fromAnnotatedClass(IllegalStateExceptionHandler.class);
    ExceptionHandlerBinding runtimeBinding = ExceptionHandlerBinding.fromAnnotatedClass(RuntimeExceptionHandler.class);
    registry = new RestExceptionHandlerRegistry(Sets.newHashSet(illegalStateBinding, runtimeBinding));
    Optional<ExceptionHandlerBinding> foundBinding = registry.findBindingFor(IllegalComponentStateException.class);
    assertThat(foundBinding)
            .isPresent()
            .contains(illegalStateBinding);
}