code: private static String getFormattedName(User user) {
      List<String> parts = new ArrayList<>();
      if (user.getTitle() != null) {
        parts.add(user.getTitle());
      }
      if (user.getFirstName() != null) {
        parts.add(user.getFirstName());
      }
      if (user.getMiddleNames() != null) {
        parts.add(user.getMiddleNames());
      }
      if (user.getLastName() != null) {
        parts.add(user.getLastName());
      }
  
      if (parts.isEmpty()) {
        return null;
      } else {
        return StringUtils.collectionToDelimitedString(parts, " ");
      }
    }
docs: Formats a MolgenisUser's name.
  
  @return String containing the user's first name, middle names and last name.