@Test
public void testChecksumStored() {

  String DISTRIBUTION_OTHER = "https://services.gradle.org/distributions/gradle-5.6.3-bin.zip";
  String SHA256_OTHER = "NOT_VALID_SHA256";
  PersistentSHA256Checksums checksums = new PersistentSHA256Checksums();
  // Should be empty initially
  assertThat(checksums.myStoredChecksums == null || checksums.myStoredChecksums.isEmpty()).isTrue();
  verifyStored(checksums, false);
  // Add a different entry to the one that is looked for
  checksums.storeChecksum(DISTRIBUTION_OTHER, SHA256);
  assertThat(checksums.myStoredChecksums).hasSize(1);
  verifyStored(checksums, false);
  // Add the same entry but with different SHA256
  checksums.storeChecksum(DISTRIBUTION, SHA256_OTHER);
  assertThat(checksums.myStoredChecksums).hasSize(2);
  verifyStored(checksums, false);
  // Replace existing entry with the expected SHA256
  checksums.storeChecksum(DISTRIBUTION, SHA256);
  assertThat(checksums.myStoredChecksums).hasSize(2);
  verifyStored(checksums, true);
}