class AddCustomResourceDefinitionVersionDecorator extends
    CustomResourceDefinitionDecorator<CustomResourceDefinitionSpecFluent<?>> {

  private String version;

  public AddCustomResourceDefinitionVersionDecorator(String name, String version) {
    super(name);
    this.version = version;
  }

  public String getName() {
    return this.name;
  }

  public String getVersion() {
    return this.version;
  }

  @Override
  public void andThenVisit(CustomResourceDefinitionSpecFluent<?> spec, ObjectMeta resourceMeta) {<FILL_FUNCTION_BODY>}

  @Override
  public Class<? extends Decorator>[] after() {
    return new Class[] { AddCustomResourceDefinitionResourceDecorator.class };
  }

  @Override
  public String toString() {
    return getClass().getName() + " [name:" + getName() + ", version:" + version + "]";
  }
}

    Predicate<CustomResourceDefinitionVersionBuilder> predicate = candidate -> candidate.getName()
        .equals(version);

    spec.removeMatchingFromVersions(predicate);
    spec.addNewVersion()
        .withName(version)
        .endVersion();
  
<methods>public void <init>(java.lang.String) ,public void andThenVisit(CustomResourceDefinitionSpecFluent<?>, ObjectMeta) <variables>