class MapperUtils {

    public static String buildUserId(String userId, String domain)
    {
        Optional<String> optionalDomain = Optional.of(domain);
        return String.format("%s%s", userId, optionalDomain.map(it -> String.format("@%s", it))
                .orElse(""))
                .toLowerCase();
    }

}