### Question:
KeyDataConfig { public String getValue() { return Optional.ofNullable(privateKeyData) .map(PrivateKeyData::getValue) .orElse(null); } KeyDataConfig(PrivateKeyData privateKeyData, PrivateKeyType type);  KeyDataConfig(); PrivateKeyType getType(); PrivateKeyData getPrivateKeyData(); String getValue(); String getSnonce(); String getAsalt(); String getSbox(); ArgonOptions getArgonOptions();  }### Answer:
@Test public void getValueWithNoPrivateKeyDataReturnsNull() { KeyDataConfig keyDataConfig = new KeyDataConfig(); assertThat(keyDataConfig.getValue()).isNull(); }
@Test public void getValueWithPrivateKeyDataReturns() { PrivateKeyData privateKeyData = mock(PrivateKeyData.class); when(privateKeyData.getValue()).thenReturn("Hellow"); KeyDataConfig keyDataConfig = new KeyDataConfig(privateKeyData, PrivateKeyType.LOCKED); assertThat(keyDataConfig.getValue()).isEqualTo("Hellow"); }