### Question:
AisChecksumCalculatingServiceV3 implements ChecksumCalculatingService { @Override public byte[] calculateChecksumForConsent(Consent<?> consent) { if (consent == null) { return new byte[0]; } if (ConsentType.AIS == consent.getConsentType()) { AisConsent aisConsent = (AisConsent) consent; return calculateChecksumForAisConsent(aisConsent); } return new byte[0]; }  @Override boolean verifyConsentWithChecksum(Consent<?> consent, byte[] checksum); @Override byte[] calculateChecksumForConsent(Consent<?> consent); @Override String getVersion();  }### Answer:
@Test void calculateChecksumForConsent_success() { AisConsent aisConsent = buildConsentTppIban(); byte[] actualResult = aisChecksumCalculatingServiceV3.calculateChecksumForConsent(aisConsent); assertArrayEquals(CHECKSUM_TPP_ACCESS_IBAN, actualResult); }
@Test void calculateChecksumForConsent_success_aspspAccesses() { AisConsent aisConsent = buildConsentAspspIban(); byte[] actualResult = aisChecksumCalculatingServiceV3.calculateChecksumForConsent(aisConsent); assertArrayEquals(CHECKSUM_ASPSP_ACCESS_IBAN, actualResult); }
@Test void calculateChecksumForConsent_successIbanAndMaskedPan() { AisConsent aisConsent = buildConsentTppIbanAndMaskedPan(); byte[] actualResult = aisChecksumCalculatingServiceV3.calculateChecksumForConsent(aisConsent); assertArrayEquals(CHECKSUM_TPP_ACCESS_IBAN_MASKEDPAN, actualResult); }
@Test void calculateChecksumForConsent_success_aspspAccessesIbanAndMaskedPan() { AisConsent aisConsent = buildConsentAspspIbanAndMaskedPan(); byte[] actualResult = aisChecksumCalculatingServiceV3.calculateChecksumForConsent(aisConsent); assertArrayEquals(CHECKSUM_ASPSP_ACCESS_IBAN_MASKEDPAN, actualResult); }
@Test void calculateChecksumForConsent_consent_is_null() { byte[] emptyArray = new byte[0]; byte[] actualResult = aisChecksumCalculatingServiceV3.calculateChecksumForConsent(null); assertArrayEquals(actualResult, emptyArray); }
@Test void calculateChecksumForConsent_consent_is_unknown_object() { byte[] emptyArray = new byte[0]; byte[] actualResult = aisChecksumCalculatingServiceV3.calculateChecksumForConsent(new TestObject()); assertArrayEquals(actualResult, emptyArray); }