### Question:
SpiAspspConsentDataProviderImpl implements SpiAspspConsentDataProvider { @Override public void updateAspspConsentData(@Nullable byte[] aspspConsentData) { if (Arrays.equals(nullToEmpty(aspspConsentData), lastKnownData)) { return; } if (aspspConsentData == null || Arrays.equals(EMPTY_BYTE_ARRAY, aspspConsentData)) { clearAspspConsentData(); return; } aspspDataService.updateAspspConsentData(new AspspConsentData(aspspConsentData, encryptedConsentId)); lastKnownData = aspspConsentData; }  @Override @NotNull byte[] loadAspspConsentData(); @Override void updateAspspConsentData(@Nullable byte[] aspspConsentData); @Override void clearAspspConsentData();  }### Answer:
@Test void settingEmptyArrayRemovesData() { when(aspspDataService.readAspspConsentData(anyString())) .thenReturn(Optional.of(SOME_CONSENT_DATA)); byte[] bytes = "some another data".getBytes(); spiAspspConsentDataProvider.updateAspspConsentData(bytes); verify(aspspDataService).updateAspspConsentData(new AspspConsentData(bytes, SOME_CONSENT_ID)); reset(aspspDataService); spiAspspConsentDataProvider.updateAspspConsentData(new byte[0]); verify(aspspDataService, never()).updateAspspConsentData(any(AspspConsentData.class)); verify(aspspDataService).deleteAspspConsentData(SOME_CONSENT_ID); }