// Arup Guha
// 10/12/2026
// Example showing the basic use of an ArrayList.
// This is the main method in Cat.java converted to use an ArrayList.

import java.util.*;

public class TestCat {

	public static void main(String[] args) {
		
		Random rndObj = new Random();
		
		// Create 20 random cats.
		ArrayList<Cat> list = new ArrayList<Cat>();
		for (int i=0; i<20; i++)
			list.add(new Cat(Cat.rndName(rndObj), rndObj.nextInt(10)+1));
		
		// Print them.
		for (int i=0; i<20; i++)
			System.out.println(list.get(i));
		System.out.println("---------------------------");
		
		// For ArrayList, we use Collections.sort.
		Collections.sort(list);
		
		// Print it, should be sorted according to compareTo in Cat.
		for (int i=0; i<20; i++)
			System.out.println(list.get(i));
		System.out.println("---------------------------");
		
		// Make the last cat cuter.
		for (int i=0; i<5; i++)
			list.get(19).increaseCute();
		
		// Resort.
		Collections.sort(list);
		
		// Let's see where that cat is now!
		for (int i=0; i<20; i++)
			System.out.println(list.get(i));
	}
}