@Test
public void shouldTransformWithPrefix() {

    AtomicReference<Optional<Credentials>> credentials = new AtomicReference<>(Optional.empty());
    writeConfigLines("credentials.username=someuser");
    observer.onPrefixedOptionalValue("credentials", Credentials::new, credentials::set);
    assertThat(credentials.get()).get().isEqualToComparingFieldByField(new Credentials("someuser", null));
    writeConfigLines("credentials.username=someuser2", "credentials.password=secret");
    assertThat(credentials.get()).get().isEqualToComparingFieldByField(new Credentials("someuser2", "secret"));
}