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