private static void tryInvoke(Method method, Object object, String[] args) {
        Class<?>[] parameters = method.getParameterTypes();
        if (parameters.length != args.length) {
            return;
        }
        for (Class<?> parameterClass : parameters) {
            if (!parameterClass.isAssignableFrom(String.class)) {
                return;
            }
        }
        try {
            method.invoke(object, args);
            System.out.println(object);
        } catch (IllegalAccessException e) {
            System.out.println("Method " + method.getName() + " is inaccessible");
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            System.out.println("Method " + method.getName() + " threw an exception");
            e.printStackTrace();
        }
    }