### Question:
XWikiUser { @Unstable public boolean isEmailChecked(XWikiContext context) { boolean isChecked; if (isGuest() || isSuperAdmin()) { isChecked = true; } else { try { XWikiDocument userdoc = getUserDocument(context); DocumentReference userClassReference = getUserClassReference(userdoc.getDocumentReference().getWikiReference()); isChecked = userdoc.getIntValue(userClassReference, EMAIL_CHECKED_PROPERTY, 1) != 0; } catch (XWikiException e) { this.logger.error("Error while checking email_checked status of user [{}]", getUser(), e); isChecked = true; } } return isChecked; } @Unstable  XWikiUser(DocumentReference userReference); @Unstable  XWikiUser(DocumentReference userReference, boolean main); @Deprecated  XWikiUser(String user); @Deprecated  XWikiUser(String user, boolean main); @Deprecated String getUser(); String getFullName(); DocumentReference getUserReference(); @Unstable boolean isEmailChecked(XWikiContext context); @Unstable void setEmailChecked(boolean checked, XWikiContext context); @Unstable boolean isDisabled(XWikiContext context); @Unstable void setDisabled(boolean disable, XWikiContext context); @Unstable boolean exists(XWikiContext context); void setUser(String user); boolean isUserInGroup(String groupName, XWikiContext context); boolean isMain(); void setMain(boolean main); @Override String toString(); @Override boolean equals(Object obj); @Unstable
    static final String ACTIVE_PROPERTY; @Unstable
    static final String EMAIL_CHECKED_PROPERTY; }### Answer:
@Test public void isEmailChecked() { XWikiUser user = new XWikiUser(userReference); when(userDocument.getIntValue(userClassReference, XWikiUser.EMAIL_CHECKED_PROPERTY, 1)).thenReturn(1); assertTrue(user.isEmailChecked(mockitoOldcore.getXWikiContext())); when(userDocument.getIntValue(userClassReference, XWikiUser.EMAIL_CHECKED_PROPERTY, 1)).thenReturn(0); assertFalse(user.isEmailChecked(mockitoOldcore.getXWikiContext())); user = new XWikiUser((DocumentReference) null); assertTrue(user.isEmailChecked(mockitoOldcore.getXWikiContext())); user = new XWikiUser(XWikiRightService.SUPERADMIN_USER_FULLNAME); assertTrue(user.isEmailChecked(mockitoOldcore.getXWikiContext())); }