/** * Returns a new instance of {@code MessageHeadersBuilder} initialized with the the properties of the given map. * * @param headers the header map which provides the initial properties of the builder. * @return a builder for creating {@code MessageHeaders} object. * @throws NullPointerException if {@code headers} is {@code null}. * @throws IllegalArgumentException if {@code headers} contains a value that did not represent its appropriate Java * type or if {@code headers} did lack a mandatory header. * @throws SubjectInvalidException if {@code headers} contains an invalid value for * {@link MessageHeaderDefinition#SUBJECT}. */ public static MessageHeadersBuilder of(final Map<String, String> headers) { validateMandatoryHeaders(headers); return new MessageHeadersBuilder(headers); }