UNB/ CS/ David Bremner/ teaching/ java/ Unique.java
public class Unique
{  public static void main(String[] args)
   {  ConsoleReader console = new ConsoleReader(System.in);
   
      String lastLine = "";

      boolean done = false;
      while (!done)
      {  String inputLine = console.readLine();
         if (inputLine == null)
            done = true;
         else if (!inputLine.equals(lastLine))
         {  // it's a different line from its predecessor
            System.out.println(inputLine);
            lastLine = inputLine;
         }
      }
   }
}