testResponsibleForValue(false, false, true);  } catch (ExcepcaoPersistencia e) { testResponsibleForValue(false, false, true);
fail("Unexpected InvalidCategory Exception");
    public void testUpdateResponsabilitiesFor() {                       try{            teacher3.updateResponsabilitiesFor(null, null);            fail("Expected NullPointerException");        }        catch(NullPointerException e){            testResponsibleForValue(true, false, true);        }        catch (MaxResponsibleForExceed e) {            fail("Expected NullPointerException");        }         catch (InvalidCategory e) {            fail("Expected NullPointerException");        }         catch (ExcepcaoPersistencia e) {            fail("Expected NullPointerException");        }                List newResponsabilities = new ArrayList();        newResponsabilities.add(1);                ///////////////////////////                teacher3.getCategory().setCanBeExecutionCourseResponsible(true);                        try {            teacher3.updateResponsabilitiesFor(executionYear.getIdInternal(), newResponsabilities);            fail("Expected MaxResponsibleForExceed");                    } catch (MaxResponsibleForExceed e) {            testResponsibleForValue(false, false, true);                         // O primeiro argumento  false porque nos testes n existe mecanismo transacional logo se ocorrer um excepo             // todas as alteraes efectuadas ateriormente no sero repostas.                } catch (InvalidCategory e) {            fail("Expected MaxResponsibleForExceed");               } catch (ExcepcaoPersistencia e) {            fail("Expected MaxResponsibleForExceed");        }                //////////////////////////                teacher3.getCategory().setCanBeExecutionCourseResponsible(false);                try {            teacher3.updateResponsabilitiesFor(executionYear.getIdInternal(), newResponsabilities);            fail("Expected InvalidCategory");                    } catch (MaxResponsibleForExceed e) {            fail("Expected InvalidCategory");                            } catch (InvalidCategory e) {            testResponsibleForValue(false, false, true);               } catch (ExcepcaoPersistencia e) {            fail("Expected InvalidCategory");        }                /////////////////////////                professorship5.setResponsibleFor(false);        teacher3.getCategory().setCanBeExecutionCourseResponsible(true);                try {            teacher3.updateResponsabilitiesFor(executionYear.getIdInternal(), newResponsabilities);                    } catch (MaxResponsibleForExceed e) {            testResponsibleForValue(false, false, true);                            } catch (InvalidCategory e) {            testResponsibleForValue(false, false, true);               } catch (ExcepcaoPersistencia e) {            testResponsibleForValue(false, false, true);        }                testResponsibleForValue(false, true, false);        } 