class Username {

    public static Username from(String localPart, Optional<String> domain) {
       return new Username(localPart, domain.map(Domain::of));
    }

    private  Username(String localPart, Optional<Domain> domainPart);

}