@Test
public void testGetChecksum() throws NoSuchAlgorithmException, IOException {

  final Object[][] testParameters =
      new Object[][] {
          {new ByteArrayInputStream(new byte[] {1, 2, 3}),
              new byte[] {82, -119, -33, 115, 125, -11, 115, 38, -4, -35, 34, 89, 122, -5, 31,
                  -84}},
          {new ByteArrayInputStream(new byte[] {4, 5, 6, 7, 8}),
              new byte[] {-94, -23, -23, -60, 5, -4, -76, 40, 8, -49, -96, -22, -14, 82, 124,
                  55}},
          {new ByteArrayInputStream(new byte[] {9, 10, 11, 12, 13, 14, 15}), new byte[] {-80, -53,
              24, -101, -113, 102, 100, 106, -112, 42, 57, -61, 15, 35, -61, -93}}};
  for (final Object[] testParameter : testParameters) {
    byte[] expected = (byte[]) testParameter[1];
    InputStream in = (InputStream) testParameter[0];
    byte[] actual = IoUtils.getChecksum(in);
    for (int i = 0; i < actual.length; ++i) {
      assertEquals(expected[i], actual[i]);
    }
  }
}