public static boolean isOrHasCause(Throwable t, Class<?> classToFind) {
        while (t != null && t.getCause() != t && !classToFind.isAssignableFrom(t.getClass())) {
            t = t.getCause();
        }
        return t != null && classToFind.isAssignableFrom(t.getClass());
    }
@Test
    public void test_isOrHasCause_null() {
        assertFalse(isOrHasCause(null, TargetNotMemberException.class));
    }