// The Flock (a list of Boid objects) class Flock { ArrayList boids; // An ArrayList for all the boids Flock() { boids = new ArrayList(); // Initialize the ArrayList } void run() { for (Boid b : boids) { b.run(boids); // Passing the entire list of boids to each boid individually } } void addBoid(Boid b) { boids.add(b); } }