public static Credential from(String username, String password) {
    return new Credential(username, password);
  }
@Test
  public void testCredentialsHash() {
    Credential credentialA1 = Credential.from("username", "password");
    Credential credentialA2 = Credential.from("username", "password");
    Credential credentialB1 = Credential.from("", "");
    Credential credentialB2 = Credential.from("", "");

    Assert.assertEquals(credentialA1, credentialA2);
    Assert.assertEquals(credentialB1, credentialB2);
    Assert.assertNotEquals(credentialA1, credentialB1);
    Assert.assertNotEquals(credentialA1, credentialB2);

    Set<Credential> credentialSet =
        new HashSet<>(Arrays.asList(credentialA1, credentialA2, credentialB1, credentialB2));
    Assert.assertEquals(new HashSet<>(Arrays.asList(credentialA2, credentialB1)), credentialSet);
  }