Source of UtilsTester.java


  1: import java.util.*;
  2: import java.awt.*;

  4: public class UtilsTester
  5: {
  6:    public static void main(String[] args)
  7:          throws InstantiationException, IllegalAccessException
  8:    {
  9:       ArrayList<String> ids = new ArrayList<String>(); 
 10:       Utils.fill(ids, "default", 10);
 11:       System.out.println(ids);

 13:       ArrayList<Shape> shapes = new ArrayList<Shape>();
 14:       Utils.fill(shapes, new Rectangle(5, 10, 20, 30), 2);
 15:       System.out.println(shapes);

 17:       ArrayList<Polygon> polys = new ArrayList<Polygon>();
 18:       Utils.fillWithDefaults(polys, Polygon.class, 10);
 19:       Utils.append(shapes, polys, 2);
 20:       System.out.println(shapes);      

 22:       ArrayList<GregorianCalendar> dates 
 23:             = new ArrayList<GregorianCalendar>();
 24:       Utils.fillWithDefaults(dates, GregorianCalendar.class, 5);
 25:       System.out.println(Utils.getMax(dates));
 26:    }
 27: }