static Predicate obtainPredicateFromInstance(final Object instance) {
        if (Predicate.class.isAssignableFrom(instance.getClass())) {
            return (Predicate) instance;
        } else {
            throw new IllegalArgumentException(ERROR_PREDICATE_CLASS);
        }
    }
@Test
    void obtainPredicateFromInstanceWhenNotPredicateInstance() {
        String expectedPredicate = "thisMightHurt";
        Exception ex = assertThrows(IllegalArgumentException.class,
                () -> DynamicRouterControlService.obtainPredicateFromInstance(expectedPredicate));
        assertEquals(ERROR_PREDICATE_CLASS, ex.getMessage());
    }