import lombok.With;

/**
 * Test class for renaming fields in a class with @With annotation
 */
public class RenameFieldWithWithAnnotation {
  @With
  private final String newField;
  private int count;

  public RenameFieldWithWithAnnotation(String newField, int count) {
    this.newField = newField;
    this.count = count;
  }

  public void printInfo() {
    System.out.println("Field value: " + newField + ", Count: " + count);
  }

  public void useWithMethod() {
    // Using the with method generated by Lombok
    RenameFieldWithWithAnnotation updated = withNewField("new value");
    System.out.println("Updated field: " + updated.newField);
  }
}