code: public static Message getMessage(final Supplier<?> supplier, final MessageFactory messageFactory) {
          if (supplier == null) {
              return null;
          }
          final Object result = supplier.get();
          return result instanceof Message ? (Message) result : messageFactory.newMessage(result);
      }
docs: Returns a Message, either the value supplied by the specified function, or a new Message created by the specified
  Factory.
  @param supplier a lambda expression or {@code null}
  @return the Message resulting from evaluating the lambda expression or the Message created by the factory for
  supplied values that are not of type Message