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