class InternalEmailUtil {

    private InternalEmailUtil() {}

    private static final String ID_FIELD_NAME    = "user_id";
    private static final String EMAIL_FIELD_NAME = "user_mail";
    private static final String DEFAULT_EMAIL    = "no-mail-specified";
    private static final Preferences PREFERENCES =
        Preferences.userNodeForPackage(InternalEmailUtil.class);

    public static boolean hasEmail() {
        final String storedEmail = PREFERENCES.get(EMAIL_FIELD_NAME, null);
        if (storedEmail == null) {
            return false;
        }
        return !DEFAULT_EMAIL.equals(storedEmail);
    }

    public static String getEmail() {
        return Optional.ofNullable(
            PREFERENCES.get(EMAIL_FIELD_NAME, null)
        ).orElse(DEFAULT_EMAIL);
    }

    public static void removeEmail() {
        PREFERENCES.remove(EMAIL_FIELD_NAME);
    }

    public static void setEmail(String email) {
        requireNonNull(email);
        PREFERENCES.put(EMAIL_FIELD_NAME, email);
    }

    public static UUID getUserId() {<FILL_FUNCTION_BODY>}

}

        final String id = PREFERENCES.get(ID_FIELD_NAME, "");
        try {
            return UUID.fromString(id);
        } catch (final IllegalArgumentException ex) {
            final UUID generated = UUID.randomUUID();
            PREFERENCES.put(ID_FIELD_NAME, generated.toString());
            return generated;
        }
    
<no_super_class>