code: public static void main(String[] args) throws Exception {
          if (args.length > 0) {
              PID p = new PID(args[0]);
              System.out.println("Normalized    : " + p.toString());
              System.out.println("To filename   : " + p.toFilename());
              System.out.println("From filename : "
                      + PID.fromFilename(p.toFilename()).toString());
          } else {
              System.out.println("--------------------------------------");
              System.out.println("PID Syntax Checker - Interactive mode");
              System.out.println("--------------------------------------");
              boolean done = false;
              BufferedReader reader =
                      new BufferedReader(new InputStreamReader(System.in));
              while (!done) {
                  try {
                      System.out.print("Enter a PID (ENTER to exit): ");
                      String line = reader.readLine();
                      if (line.isEmpty()) {
                          done = true;
                      } else {
                          PID p = new PID(line);
                          System.out.println("Normalized    : " + p.toString());
                          System.out.println("To filename   : " + p.toFilename());
                          System.out.println("From filename : "
                                  + PID.fromFilename(p.toFilename()).toString());
                      }
                  } catch (MalformedPIDException e) {
                      System.out.println("ERROR: " + e.getMessage());
                  }
              }
          }
      }
docs: Command-line interactive tester. If one arg given, prints normalized form
  of that PID and exits. If no args, enters interactive mode.