### Question:
ProcessFormService { public long ensureProcessDefinitionId(final APISession apiSession, final long processDefinitionId, final long processInstanceId, final long taskInstanceId) throws ArchivedProcessInstanceNotFoundException, ActivityInstanceNotFoundException, BonitaException { if (processDefinitionId != -1L) { return processDefinitionId; } else if (processInstanceId != -1L) { return getProcessDefinitionIdFromProcessInstanceId(apiSession, processInstanceId); } else { return getProcessDefinitionIdFromTaskId(apiSession, taskInstanceId); } }  String getProcessPath(final APISession apiSession, final long processDefinitionId); String encodePathSegment(final String stringToEncode); long getProcessDefinitionId(final APISession apiSession, final String processName, final String processVersion); long getTaskInstanceId(final APISession apiSession, final long processInstanceId, final String taskName, final long userId); String getTaskName(final APISession apiSession, final long taskInstanceId); long ensureProcessDefinitionId(final APISession apiSession, final long processDefinitionId, final long processInstanceId, final long taskInstanceId); boolean isAllowedToSeeTask(final APISession apiSession, final long taskInstanceId, final long enforcedUserId,
            final boolean assignTask); boolean isAllowedToSeeProcessInstance(final APISession apiSession, final long processInstanceId,
            final long enforcedUserId); boolean isAllowedToStartProcess(final APISession apiSession, final long processDefinitionId, final long enforcedUserId); boolean isAllowedAsAdminOrProcessSupervisor(final HttpServletRequest request, final APISession apiSession, final long processDefinitionId,
            final long taskInstanceId, final long userId, final boolean assignTask);  }### Answer:
@Test public void ensureProcessDefinitionId_with_processDefinitionId() throws Exception { assertEquals(42L, processFormService.ensureProcessDefinitionId(apiSession, 42L, -1L, -1L)); }