private AuthorEntity(final UserDetail userDetail) {
   if (userDetail != null) {
     this.fullName = userDetail.getDisplayedName();
     this.id = userDetail.getId();
     this.avatar = userDetail.getAvatar();
     UserPreferences prefs = getUserPreferences();
     if (prefs != null) {
       this.language = prefs.getLanguage();
     } else {
       this.language = DisplayI18NHelper.getDefaultLanguage();
     }
   }
 }
  @Test
  public void testUpdatePersonalizeDetail() throws Exception {
    String userId = "1000";
    final UserPreferences expectedDetail = actualUserPreferencesForUserId(userId);
    UserPreferences detail = dao.getById(userId);
    assertThat(detail, notNullValue());
    assertThat(detail, PersonalizationMatcher.matches(expectedDetail));

    assertThat(expectedDetail.getLanguage(), is(not("DUMMY")));
    expectedDetail.setLanguage("DUMMY");

    Transaction.performInOne(() -> dao.save(expectedDetail));

    UserPreferences actual = actualUserPreferencesForUserId(userId);
    assertThat(actual, notNullValue());
    assertThat(actual, PersonalizationMatcher.matches(expectedDetail));
    assertThat(actual.getLanguage(), is("DUMMY"));
  }