for (int i = 0; i < contribs.length; i++)
int len = Math.min (capacitiesUsed.length, contribs.length); for (int i = 0; i < len; i++)
  public void addCapacityContribs (float[] contribs) {    for (int i = 0; i < contribs.length; i++)      capacitiesUsed[i] += contribs[i];  }