class ClusterServicePlanOperationsImpl extends ExtensibleResourceAdapter<ClusterServicePlan>
    implements ClusterServicePlanResource {

  @Override
  public ExtensibleResourceAdapter<ClusterServicePlan> newInstance() {
    return new ClusterServicePlanOperationsImpl();
  }

  @Override
  public ServiceInstance instantiate(String... args) {<FILL_FUNCTION_BODY>}

  @Override
  public ServiceInstanceResource instantiateAnd(String... args) {
    ServiceInstance item = instantiate(args);
    return client.adapt(ServiceCatalogClient.class).serviceInstances().resource(item);
  }

}

    String instanceName;
    String instanceNamespace;

    if (args.length == 1) {
      instanceName = args[0];
      instanceNamespace = client.getConfiguration().getNamespace();
    } else if (args.length == 2) {
      instanceNamespace = args[0];
      instanceName = args[1];
    } else {
      throw new IllegalArgumentException(
          "Instantiate needs to be called with either <namespace> <instance name> or <instance name> arguments, but instead found: "
              + args.length + " arguments.");
    }

    ClusterServicePlan item = get();
    return client.adapt(ServiceCatalogClient.class).serviceInstances()
        .inNamespace(instanceNamespace).create(new ServiceInstanceBuilder()
            .withNewMetadata()
            .withName(instanceName)
            .withNamespace(instanceNamespace)
            .endMetadata()
            .withNewSpec()
            .withClusterServiceClassName(item.getSpec().getClusterServiceClassRef().getName())
            .withClusterServicePlanName(item.getMetadata().getName())
            .endSpec()
            .build());
  
<methods>public void <init>() ,public ExtensibleResource<ClusterServicePlan> dryRun(boolean) ,public ExtensibleResource<ClusterServicePlan> fieldManager(java.lang.String) ,public ExtensibleResource<ClusterServicePlan> fieldValidation(io.fabric8.kubernetes.client.dsl.FieldValidateable.Validation) ,public ExtensibleResource<ClusterServicePlan> forceConflicts() ,public ExtensibleResource<ClusterServicePlan> fromServer() ,public ClusterServicePlan getItem() ,public C inWriteContext(Class<C>) ,public ExtensibleResourceAdapter<ClusterServicePlan> init(ExtensibleResource<ClusterServicePlan>, io.fabric8.kubernetes.client.Client) ,public ExtensibleResource<ClusterServicePlan> lockResourceVersion(java.lang.String) ,public ExtensibleResource<ClusterServicePlan> lockResourceVersion() ,public abstract ExtensibleResourceAdapter<ClusterServicePlan> newInstance() ,public ExtensibleResource<ClusterServicePlan> subresource(java.lang.String) ,public ExtensibleResource<ClusterServicePlan> unlock() ,public ExtensibleResource<ClusterServicePlan> withGracePeriod(long) ,public ExtensibleResource<ClusterServicePlan> withIndexers(Map<java.lang.String,Function<ClusterServicePlan,List<java.lang.String>>>) ,public ExtensibleResource<ClusterServicePlan> withLimit(java.lang.Long) ,public ExtensibleResource<ClusterServicePlan> withPropagationPolicy(io.fabric8.kubernetes.api.model.DeletionPropagation) ,public ExtensibleResource<ClusterServicePlan> withResourceVersion(java.lang.String) ,public ExtensibleResource<ClusterServicePlan> withTimeout(long, java.util.concurrent.TimeUnit) ,public ExtensibleResource<ClusterServicePlan> withTimeoutInMillis(long) <variables>protected io.fabric8.kubernetes.client.Client client,protected ExtensibleResource<ClusterServicePlan> resource