code: public void populateApplicationId(ProjectView projectView, String applicationId) throws IntegrationException {
          List<ProjectMappingView> projectMappings = blackDuckService.getAllResponses(projectView, ProjectView.PROJECT_MAPPINGS_LINK_RESPONSE);
          boolean canCreate = projectMappings.isEmpty();
          if (canCreate) {
              if (!projectView.hasLink(ProjectView.PROJECT_MAPPINGS_LINK)) {
                  throw new BlackDuckIntegrationException(String.format("The supplied projectView does not have the link (%s) to create a project mapping.", ProjectView.PROJECT_MAPPINGS_LINK));
              }
              String projectMappingsLink = projectView.getFirstLink(ProjectView.PROJECT_MAPPINGS_LINK).get();
              ProjectMappingView projectMappingView = new ProjectMappingView();
              projectMappingView.setApplicationId(applicationId);
              blackDuckService.post(projectMappingsLink, projectMappingView);
          } else {
              // Currently there exists only one project-mapping which is the project's Application ID.
              // Eventually, this method would need to take in a namespace on which we will need to filter.
              ProjectMappingView projectMappingView = projectMappings.get(0);
              projectMappingView.setApplicationId(applicationId);
              blackDuckService.put(projectMappingView);
          }
      }
docs: Sets the applicationId for a project
  @throws IntegrationException