import java.util.*;
import java.lang.*;
import java.io.*;

// The main method must be in a class named "Main".
class Main {
    public static void main(String[] args) {
        var userName = findUser().map(User::getName).orElse("");
        System.out.println("Hello " + userName);
    }

    public static Optional<User> findUser() {
        return Optional.of(new User("Xavier"));
    }

    public static class User {
        private String name;

        public User(String name) {
            this.name = name;
        }

        public String getName() {
            return this.name;
        }
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: