@@ -0,0 +1,1107 @@
+import java.util.*;%0Aimport org.xbill.DNS.*;%0A%0Apublic class primary %7B%0A%0Aprivate static void%0Ausage() %7B%0A%09System.out.println(%22usage: primary %5B-t%5D %5B-a %7C -i%5D origin file%22);%0A%09System.exit(1);%0A%7D%0A%0Apublic static void%0Amain(String %5B%5D args) throws Exception %7B%0A%09boolean time = false;%0A%09boolean axfr = false;%0A%09boolean iterator = false;%0A%09int arg = 0;%0A%0A%09if (args.length %3C 2)%0A%09%09usage();%0A%0A%09while (args.length - arg %3E 2) %7B%0A%09%09if (args%5B0%5D.equals(%22-t%22))%0A%09%09%09time = true;%0A%09%09else if (args%5B0%5D.equals(%22-a%22))%0A%09%09%09axfr = true;%0A%09%09else if (args%5B0%5D.equals(%22-i%22))%0A%09%09%09iterator = true;%0A%09%09arg++;%0A%09%7D%0A%0A%09Name origin = Name.fromString(args%5Barg++%5D, Name.root);%0A%09String file = args%5Barg++%5D;%0A%0A%09long start = System.currentTimeMillis();%0A%09Zone zone = new Zone(origin, file);%0A%09long end = System.currentTimeMillis();%0A%09if (axfr) %7B%0A%09%09Iterator it = zone.AXFR();%0A%09%09while (it.hasNext()) %7B%0A%09%09%09System.out.println(it.next());%0A%09%09%7D%0A%09%7D else if (iterator) %7B%0A%09%09Iterator it = zone.iterator();%0A%09%09while (it.hasNext()) %7B%0A%09%09%09System.out.println(it.next());%0A%09%09%7D%0A%09%7D else %7B%0A%09%09System.out.println(zone);%0A%09%7D%0A%09if (time)%0A%09%09System.out.println(%22; Load time: %22 + (end - start) + %22 ms%22);%0A%7D%0A%0A%7D%0A

Add a test for loading a primary zone.