code: public MessageDigest getStrongestMessageDigest() {
          if (digestExists("SHA-512") && caps.contains(Capability.SHA_512)) {
              return getDigest("SHA-512");
          } else if (digestExists("SHA-256") && caps.contains(Capability.SHA_256)) {
              return getDigest("SHA-256");
          } else if (digestExists("SHA-1") && caps.contains(Capability.SHA_1)) {
              return getDigest("SHA-1");
          } else if (digestExists("MD5")) {
              return getDigest("MD5");
          }
          return null;
      }
docs: Returns the strongest message digest algorithm supported by the server
  and client.
  
  The algorithms are ordered thus:
  <ol>
  <li>SHA-512</li>
  <li>SHA-256</li>
  <li>SHA-1</li>
  <li>MD5</li>
  </ol>
  If none of the above algorithms are supported, this method returns null.
  
  @return the strongest message digest algorithm supported by the server
  and client.