providerCount += agentCount[Math.min(i, agentCount.length)];
providerCount += agentCount[Math.min(i, agentCount.length - 1)];
  private void setProviderCount() {    int[] agentCount = (int[]) getProperty(PROP_AGENTCOUNT).getValue();    int nLevels = getLevelCount();    int providerCount = 0;    for (int i = 0; i < nLevels; i++) {      providerCount += agentCount[Math.min(i, agentCount.length)];    }    if (propProviderCount != null) {      propProviderCount.setValue(new Integer(providerCount));    }  }