class CustomerCore extends Customer {

  private final Map<Role, CustomerRole> roles;

  public CustomerCore() {
    roles = new HashMap<>();
  }

  @Override
  public boolean addRole(Role role) {
    return role
        .instance()
        .map(inst -> {
          roles.put(role, inst);
          return true;
        })
        .orElse(false);
  }

  @Override
  public boolean hasRole(Role role) {
    return roles.containsKey(role);
  }

  @Override
  public boolean remRole(Role role) {
    return Objects.nonNull(roles.remove(role));
  }

  @Override
  public <T extends Customer> Optional<T> getRole(Role role, Class<T> expectedRole) {
    return Optional
        .ofNullable(roles.get(role))
        .filter(expectedRole::isInstance)
        .map(expectedRole::cast);
  }

  @Override
  public String toString() {<FILL_FUNCTION_BODY>}
}

    var roles = Arrays.toString(this.roles.keySet().toArray());
    return "Customer{roles=" + roles + "}";
  
<methods>public non-sealed void <init>() ,public abstract boolean addRole(com.iluwatar.roleobject.Role) ,public abstract Optional<T> getRole(com.iluwatar.roleobject.Role, Class<T>) ,public abstract boolean hasRole(com.iluwatar.roleobject.Role) ,public static com.iluwatar.roleobject.Customer newCustomer() ,public static transient com.iluwatar.roleobject.Customer newCustomer(com.iluwatar.roleobject.Role[]) ,public abstract boolean remRole(com.iluwatar.roleobject.Role) <variables>