class MBMessageResolversImpl implements MBMessageResolvers {

    @Override
    public DataFetcher<MBMessage> createMBMessageDataFetcher() {
        return environment -> {
            long userId = util.getLongArg(environment, "userId", util.getDefaultUserId());
            String userName = util.getStringArg(environment, "userName");
            long groupId = util.getLongArg(environment, "groupId");
            long categoryId = util.getLongArg(environment, "categoryId");
            long threadId = util.getLongArg(environment, "threadId");
            long parentMessageId = util.getLongArg(environment, "parentMessageId");
            String subject = util.getStringArg(environment, "subject");
            String body = util.getStringArg(environment, "body");
            String format = util.getStringArg(environment, "format");
            boolean anonymous = util.getBooleanArg(environment, "anonymous");
            double priority = util.getDoubleArg(environment, "priority");
            boolean allowPingbacks = util.getBooleanArg(environment, "allowPingbacks");
            ServiceContext serviceContext = new ServiceContext();

            return mbMessageLocalService.addMessage(
                    userId,
                    userName,
                    groupId,
                    categoryId,
                    threadId,
                    parentMessageId,
                    subject,
                    body,
                    format,
                    null,
                    anonymous,
                    priority,
                    allowPingbacks,
                    serviceContext);
        };
    }

}