// Short client program to test the Clock class. It constructs two specific // clocks and their sum and then adds several more clocks and sorts and prints // the list. import java.util.*; public class ClockClient { public static void main(String[] args) { Clock c1 = new Clock(3, 26); Clock c2 = new Clock(15, 48); Clock c3 = c1.add(c2); List list = new ArrayList(); list.add(c1); list.add(c2); list.add(c3); System.out.println(c1); System.out.println(list); int[][] data = {{23, 19}, {15, 12}, {8, 45}, {7, 8}, {12, 55}}; for (int[] time : data) { list.add(new Clock(time[0], time[1])); } System.out.println(list); Collections.sort(list); System.out.println(list); } }