/** * Creates an immutable copy of a {@link Header} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable Header instance */ public static ImmutableHeader copyOf(Header instance) { if (instance instanceof ImmutableHeader) { return (ImmutableHeader) instance; } return ImmutableHeader.builder() .from(instance) .build(); }