private static void selfTest()
  {
    String msgs[] =
      {
        "$5$saltstring", "Hello world!", "$5$saltstring$5B8vYYiY.CVt1RlTTf8KbXBH3hsxY/GNooZaBBGWEc5",
        "$5$rounds=10000$saltstringsaltstring", "Hello world!", "$5$rounds=10000$saltstringsaltst$3xv.VbSHBb41AL9AvLeujZkZRBAwqFMz2.opqey6IcA",
        "$5$rounds=5000$toolongsaltstring", "This is just a test", "$5$rounds=5000$toolongsaltstrin$Un/5jzAHMgOGZ5.mWJpuVolil07guHPvOW8mGRcvxa5",
        "$5$rounds=1400$anotherlongsaltstring", "a very much longer text to encrypt.  This one even stretches over morethan one line.", "$5$rounds=1400$anotherlongsalts$Rx.j8H.h8HjEDGomFU8bDkXm3XIUnzyxf12oP84Bnq1",
        "$5$rounds=77777$short", "we have a short salt string but not a short password", "$5$rounds=77777$short$JiO1O3ZpDAxGJeaDIuqCoEFysAe1mZNJRs3pw0KQRd/",
        "$5$rounds=123456$asaltof16chars..", "a short string", "$5$rounds=123456$asaltof16chars..$gP3VQ/6X7UUEW3HkBn2w1/Ptq2jxPyzV/cZKmF/wJvD",
        "$5$rounds=10$roundstoolow", "the minimum number is still observed", "$5$rounds=1000$roundstoolow$yfvwcWrQ8l/K0DAWyuPMDNHpIVlTQebY9l/gL972bIC"
      };

    System.out.println("Starting Sha256Crypt tests now...");

    for (int t=0; t<(msgs.length/3); t++)
      {
        String saltPrefix = msgs[t*3];
        String plainText = msgs[t*3+1];
        String cryptText = msgs[t*3+2];

        String result = Sha256_crypt(plainText, saltPrefix, 0);

        System.out.println("test " + t + " result is:" + result);
        System.out.println("test " + t + " should be:" + cryptText);

        if (result.equals(cryptText))
          {
            System.out.println("Passed crypt well");
          }
        else
          {
            System.out.println("Failed Crypt Badly");
          }

        if (verifyPassword(plainText, cryptText))
          {
            System.out.println("Passed verifyPassword well");
          }
        else
          {
            System.out.println("Failed verifyPassword Badly");
          }
      }
  }