/** * Creates an immutable copy of a {@link EventResponse} 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 EventResponse instance */ public static ImmutableEventResponse copyOf(EventResponse instance) { if (instance instanceof ImmutableEventResponse) { return (ImmutableEventResponse) instance; } return ImmutableEventResponse.builder() .from(instance) .build(); }