@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);
  }
Tests for {@link com.google.cloud.tools.jib.api.Credential}.
jib-core/src/test/java/com/google/cloud/tools/jib/api/CredentialTest.java