public class Person {
  private String name;
  private int age;

  public Person(String name, int age) {
    if (name == null) {
        throw new IllegalArgumentException("Name cannot be null.");
    }

    if (age <= 0) {
        throw new IllegalArgumentException("Age must be > 0");
    }

    this.name = name;
    this.age = age;
  }

  @Override
  public String toString() {
    return this.name + ", " + this.age;
  }

  /**
   * Check if this object is equal to the other object.
   * @param other 
   */
  @Override
public boolean equals(Object other) {
if (other == null) { return false; }
if (!this.getClass().equals(other.getClass())) { return false; }
Person otherPerson = (Person) other; return this.age == otherPerson.age && this.name.equals(otherPerson.name);
}
}