public static void main(String[] args) throws Exception {
        Logon a = new Logon("USER", "PassWord");
        System.out.println("Session a = " + a);
        ObjectOutput out = new ObjectOutputStream(new FileOutputStream("Logon.out"));
        out.writeObject(a);
        out.close();

        a = null;
        TimeUnit.SECONDS.sleep(5);

        ObjectInput in = new ObjectInputStream(new FileInputStream("Logon.out"));
        System.out.println();
        System.out.println("Restoring object. Time: " + new Date());
        a = (Logon)in.readObject();
        System.out.println("Session a = " + a);
    }