### Question:
WorkflowAction { protected ExecuteBuildingBlock buildExecuteBuildingBlock(OrchestrationFlow orchFlow, String requestId, Resource resource, String apiVersion, String resourceId, String requestAction, boolean aLaCarte, String vnfType, WorkflowResourceIds workflowResourceIds, RequestDetails requestDetails, boolean isVirtualLink, String virtualLinkKey, String vnfcName, boolean isConfiguration, ReplaceInstanceRelatedInformation replaceInfo) { BuildingBlock buildingBlock = new BuildingBlock().setBpmnFlowName(orchFlow.getFlowName()).setMsoId(UUID.randomUUID().toString()) .setIsVirtualLink(isVirtualLink).setVirtualLinkKey(virtualLinkKey) .setKey(Optional.ofNullable(resource).map(Resource::getResourceId).orElse("")); Optional.ofNullable(orchFlow.getBpmnAction()).ifPresent(buildingBlock::setBpmnAction); Optional.ofNullable(orchFlow.getBpmnScope()).ifPresent(buildingBlock::setBpmnScope); String oldVolumeGroupName = ""; if (replaceInfo != null) { oldVolumeGroupName = replaceInfo.getOldVolumeGroupName(); } if (resource != null && (orchFlow.getFlowName().contains(VOLUMEGROUP) && (requestAction.equalsIgnoreCase(REPLACEINSTANCE) || requestAction.equalsIgnoreCase(REPLACEINSTANCERETAINASSIGNMENTS)))) { logger.debug("Setting resourceId to volume group id for volume group flow on replace"); resourceId = workflowResourceIds.getVolumeGroupId(); } ExecuteBuildingBlock executeBuildingBlock = new ExecuteBuildingBlock().setApiVersion(apiVersion) .setaLaCarte(aLaCarte).setRequestAction(requestAction).setResourceId(resourceId).setVnfType(vnfType) .setWorkflowResourceIds(workflowResourceIds).setRequestId(requestId).setBuildingBlock(buildingBlock) .setRequestDetails(requestDetails).setOldVolumeGroupName(oldVolumeGroupName); if (resource != null && (isConfiguration || resource.getResourceType().equals(WorkflowType.CONFIGURATION))) { ConfigurationResourceKeys configurationResourceKeys = getConfigurationResourceKeys(resource, vnfcName); executeBuildingBlock.setConfigurationResourceKeys(configurationResourceKeys); } return executeBuildingBlock; }  void setBbInputSetupUtils(BBInputSetupUtils bbInputSetupUtils); void setBbInputSetup(BBInputSetup bbInputSetup); void selectExecutionList(DelegateExecution execution); void handleRuntimeException(DelegateExecution execution);  }### Answer:
@Test public void verifyLackOfNullPointerExceptionForNullResource() { ExecuteBuildingBlock result = null; try { result = workflowAction.buildExecuteBuildingBlock(new OrchestrationFlow(), null, null, null, null, null, false, null, null, null, false, null, null, true, null); } catch (NullPointerException e) { fail("NullPointerException should not be thrown when 'resource' is null"); } assertNotNull(result); }