static <T> StreamMessage<T> of(Publisher<? extends T> publisher) {
        requireNonNull(publisher, "publisher");

        if (publisher instanceof StreamMessage) {
            @SuppressWarnings("unchecked")
            final StreamMessage<T> cast = (StreamMessage<T>) publisher;
            return cast;
        } else {
            return new PublisherBasedStreamMessage<>(publisher);
        }
    }
Creates a new {@link StreamMessage} from the specified {@link Publisher}.
core/src/main/java/com/linecorp/armeria/common/stream/StreamMessage.java