EncryptorProviderService { public boolean isInitialized() { return encryptorReference.get() != null; }  boolean isInitialized(); Encryptor getEncryptor(); void setEncryptor(Encryptor encryptor);  }
@Test public void isInitialized() { assertFalse(service.isInitialized()); service.setEncryptor(mock(Encryptor.class)); assertTrue(service.isInitialized()); }