### Question:
ProcessFormService { public boolean isAllowedToSeeProcessInstance(final APISession apiSession, final long processInstanceId, final long enforcedUserId) throws BonitaException { final ProcessAPI processAPI = getProcessAPI(apiSession); return processAPI.isInvolvedInProcessInstance(enforcedUserId, processInstanceId); }  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 isAllowedToSeeProcessInstance_should_return_true() throws Exception { when(processAPI.isInvolvedInProcessInstance(1L, 42L)).thenReturn(true); final boolean isAllowedToSeeProcessInstance = processFormService.isAllowedToSeeProcessInstance(apiSession, 42L, 1L); assertTrue(isAllowedToSeeProcessInstance); }
@Test public void isAllowedToSeeProcessInstance_should_return_false() throws Exception { when(processAPI.isInvolvedInProcessInstance(1L, 42L)).thenReturn(false); final boolean isAllowedToSeeProcessInstance = processFormService.isAllowedToSeeProcessInstance(apiSession, 42L, 1L); assertFalse(isAllowedToSeeProcessInstance); }