code: public String[] validate() {
          List<String> result = new ArrayList<>();
  
          if (this.username == null) {
              result.add("Username unspecified");
          }
          if (this.email == null && this.verifyEmail == null) {
              result.add("Email unspecified");
          } else if ((this.email == null) || (this.verifyEmail == null) || (!this.email
                  .equals(
                          this.verifyEmail))) {
              result.add("Mismatched emails");
          }
  
          return result.toArray(new String[result.size()]);
      }
docs: Validate a {@link UserRequest} object. Two rules are implemented: 1) The
  email addresses in the two email fields must match, and 2) The passwords
  in the two password fields must match.
  
  @return an array of validation error messages, or an empty array if
  validation succeeded.