public String inspect(Object o) {

        Class c = o instanceof Class ? (Class) o : o.getClass();

        StringBuilder sb = new StringBuilder();
        sb.append("Class: ").append(c.getName()).append("\n");

        sb.append("Methods:\n");
        Method[] methods = c.getDeclaredMethods();

        for (Method method : methods) {
            sb
                    .append(Modifier.toString(method.getModifiers()))
                    .append(" ")
                    .append(method.getReturnType().getSimpleName())
                    .append(" ")
                    .append(method.getName())
                    .append("(");
            Class<?>[] parameterTypes = method.getParameterTypes();
            for (int i = 0; i < parameterTypes.length; i++) {
                sb.append(parameterTypes[i].getName());
                if (i != parameterTypes.length - 1) {
                    sb.append(", ");
                }
            }

            sb.append(")\n");
        }

        sb.append("\nFields:\n");
        Field[] fields = c.getDeclaredFields();

        for (Field field : fields) {
            sb.append(Modifier.toString(field.getModifiers())).append(" ").append(field.getType().getSimpleName()).append(" ").append(field.getName()).append("\n");
        }

        return sb.toString();
    }