import lombok.experimental.Wither;
import lombok.experimental.FieldNameConstants;

/**
 * Test class for renaming fields in a class with both @Wither and @FieldNameConstants annotations
 */
@FieldNameConstants
public class RenameFieldWithWitherAndFieldNameConstants {
  @Wither
  private final String oldField;
  private int count;

  public RenameFieldWithWitherAndFieldNameConstants(String oldField, int count) {
    this.oldField = oldField;
    this.count = count;
  }

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

  public void useWitherMethod() {
    // Using the wither method generated by Lombok
    RenameFieldWithWitherAndFieldNameConstants updated = withOldField("new value");
    System.out.println("Updated field: " + updated.oldField);
  }

  public void useFieldNameConstants() {
    // Using the field name constants generated by Lombok
    System.out.println("Field name constant: " + Fields.oldField);

    // Using the field name constants in a method
    validateField(Fields.oldField);
  }

  private void validateField(String fieldName) {
    System.out.println("Validating field: " + fieldName);
  }
}