if (society != null) { AgentComponent[] sags = society.getAgents();
if (societyComponent != null) { AgentComponent[] sags = societyComponent.getAgents();
  private List getAgentsInSociety() {    List agents = new ArrayList();    if (society != null) {      AgentComponent[] sags = society.getAgents();      if (sags != null && sags.length > 0)	agents.addAll(Arrays.asList(sags));    }    return agents;  }