@Test
public void calculateTest() {

    for (int i = 0; i < 256; i++) {
        assertWithMessage("domain test: " + i).that(calculate((byte) i)).isEqualTo(toTwoBytes(TEST_DOMAIN[i]));
    }
    assertWithMessage("test domain 2 full").that(calculate(TEST_DOMAIN_2)).isEqualTo(toTwoBytes(0xC056));
    assertWithMessage("test domain 2 full indexed").that(calculate(TEST_DOMAIN_2, TEST_DOMAIN_2.length)).isEqualTo(toTwoBytes(0xC056));
    for (int i = 0; i <= TEST_DOMAIN_2.length; i++) {
        assertWithMessage("reference test: " + i).that(calculate(TEST_DOMAIN_2, i)).isEqualTo(toTwoBytes(TEST_DOMAIN_3[i]));
    }
}