== Noncompliant Code Example

----
public class Team {

  int limit = 30;
  List<Player> roster;  // Noncompliant; no default & not initialized by constructor
  Person coach;

  public Team (Person coach) { // roster is left uninitialized
    this.coach = coach;
  }

  public void add(Player p) {
    if (roster == null) {
      roster = new ArrayList<Player>();
    }
    roster.add(p);
  }

  public boolean isFull() {  // NPE if called before add()
    return roster.size() < limit;
  }
}
----
