StorageProviderUtil { public static String compareChecksum(StorageProvider provider, String spaceId, String contentId, String checksum) throws StorageException { String providerChecksum = provider.getContentProperties(spaceId, contentId). get(StorageProvider.PROPERTIES_CONTENT_CHECKSUM); return compareChecksum(providerChecksum, spaceId, contentId, checksum); } private  StorageProviderUtil(); static Map<String, String> loadProperties(InputStream is); static ByteArrayInputStream storeProperties(
        Map<String, String> propertiesMap); static String compareChecksum(StorageProvider provider,
                                         String spaceId,
                                         String contentId,
                                         String checksum); static String compareChecksum(String providerChecksum,
                                         String spaceId,
                                         String contentId,
                                         String checksum); static boolean contains(Iterator<String> iterator, String value); static long count(Iterator<String> iterator); static List<String> getList(Iterator<String> iterator); static Map<String, String> createContentProperties(String absolutePath,
                                                              String creator); static Map<String, String> removeCalculatedProperties(Map<String, String> contentProperties);  }
@Test public void testCompareChecksum() throws Exception { String spaceId = "spaceId"; String contentId = "contentId"; String checksum = "1"; String finalChecksum = StorageProviderUtil.compareChecksum(checksum, spaceId, contentId, checksum); assertEquals(checksum, finalChecksum); try { String wrongChecksum = "2"; StorageProviderUtil.compareChecksum(wrongChecksum, spaceId, contentId, checksum); fail("Exception expected comparing different checksums"); } catch (ChecksumMismatchException expected) { assertNotNull(expected); } }