### Question:
PasswordCredentials implements Credentials { public static PasswordCredentials get(final String password) { if (password.startsWith(Type.MD5.prefix())) { return new DigestPasswordCredentials( Type.MD5.algorithm, password.substring(Type.MD5.prefix().length()) ); } return new PlainPasswordCredentials(password); } protected  PasswordCredentials(final String password); static PasswordCredentials get(final String password); String password(); abstract boolean verify(final Object credentials); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void shouldReturnDigest() { PasswordCredentials credentials = PasswordCredentials.get("MD5:5f4dcc3b5aa765d61d8327deb882cf99"); Assertions.assertTrue(credentials instanceof DigestPasswordCredentials); }
@Test public void shouldReturnPlain() { PasswordCredentials credentials = PasswordCredentials.get("password"); Assertions.assertTrue(credentials instanceof PlainPasswordCredentials); }