EmployeeHistoric employeeHistoric = getEmployee(teacher);
IEmployeeHistoric employeeHistoric = getEmployee(teacher);
		public IDepartment readByTeacher(Integer teacherId) throws ExcepcaoPersistencia {			ITeacher teacher = (ITeacher)readByOID(Teacher.class, teacherId);	        EmployeeHistoric employeeHistoric = getEmployee(teacher);	        ICostCenter workingCC = employeeHistoric.getWorkingPlaceCostCenter();	        List<IDepartment> departmentList = new ArrayList();	        IDepartment department = null;	        if (workingCC != null) {	            String code = workingCC.getCode();	            if (code != null && !(code.equals(""))) {					Collection<IDepartment> departments = readAll(Department.class);										for (IDepartment departmentIt : departments){						String subCodeIt = departmentIt.getCode().substring(0, 2);						String subCode = code.substring(0,2);												if (subCodeIt.equals(subCode))							departmentList.add(departmentIt);					}	            }	            if (departmentList.size() != 1) {										Collection<IDepartment> departments = readAll(Department.class);										for (IDepartment departmentIt : departments){						if (departmentIt.getCode().equals(code)){							department = departmentIt;							break;						}							}	            } else {	                department = departmentList.get(0);	            }	        }	        return department;	    }