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