@SuppressWarnings("unchecked")
    public static <T> String errorMsg(Class<T> c, List<Object> instances) {
        final Predicate<Constructor<?>> onlyInject;
        if (hasConstructorWithInjectAnnotation(c)) {
            onlyInject = constr -> constr.isAnnotationPresent(Inject.class);
        } else {
            onlyInject = constr -> true;
        }

        return String.format("%s: %n", c.getSimpleName()) + Arrays.stream(c.getDeclaredConstructors())
            .map(constructor -> (Constructor<T>) constructor)
            .filter(onlyInject)
            .map(con ->
                String.format("  %s %s %n %s ",
                    con.isAnnotationPresent(Inject.class) ? "@Inject" : "       ",
                    con.toString(),
                    Stream.of(con.getParameters())
                    .map(p -> {
                        if (paramIsConfig(p)) {
                            return String.format("      %s %s%n", Config.class.getSimpleName(), p.toString());
                        } else {
                            return String.format("      %s %s%n", p.toString(), paramIsInjectable(p, instances) ? "" : " <-- Missing");
                        }
                    }).collect(joining(String.format("%n")))
                )
            ).collect(joining(String.format("%n")));
    }
Some common utility methods for analyzing classes with reflection.

@author Emil Forslund
@since 1.0.0
common-parent/injector/src/main/java/com/speedment/common/injector/internal/util/ReflectionUtil.java