class EtagGenerator implements EtagGeneratorInterface {

    @Override
    public String getEtag(int primaryKey) {
        return DigestUtils.md5DigestAsHex(ByteBuffer.allocate(10).putInt(primaryKey).put(secret).array());
    }

}

class EtagGeneratorTest {

    private EtagGeneratorInterface target;

    @Test
    void shouldReturnCorrectEtag() {

        Assertions.assertThat(target.getEtag(1)).isEqualTo("6bd26b412635ad2a7bdbe07b9f2f6e8b");
    }

}