final StudentCurricularPlan studentCurricularPlan = (StudentCurricularPlan) readByOID(
final IStudentCurricularPlan studentCurricularPlan = (IStudentCurricularPlan) readByOID(
	public IGratuitySituation readByStudentCurricularPlanAndGratuityValuesAndGratuitySituationType(			final Integer studentCurricularPlanID, final Integer gratuityValuesID,			GratuitySituationType gratuitySituationType) throws ExcepcaoPersistencia {		final StudentCurricularPlan studentCurricularPlan = (StudentCurricularPlan) readByOID(				StudentCurricularPlan.class, studentCurricularPlanID);		final List<IGratuitySituation> gratuitySituationsFromCurricularPlan = studentCurricularPlan				.getGratuitySituations();		if (gratuitySituationType != null) {			for (final IGratuitySituation gratuitySituation : gratuitySituationsFromCurricularPlan) {				if (gratuitySituation.getGratuityValues().getIdInternal().equals(gratuityValuesID)) {					switch (gratuitySituationType) {					case CREDITOR:						if (gratuitySituation.getRemainingValue() < 0) {							return gratuitySituation;						}						break;					case DEBTOR:						if (gratuitySituation.getRemainingValue() > 0) {							return gratuitySituation;						}						break;					case REGULARIZED:						if (gratuitySituation.getRemainingValue() == 0) {							return gratuitySituation;						}						break;					default:						break;					}				}			}		} else {			for (final IGratuitySituation gratuitySituation : gratuitySituationsFromCurricularPlan) {				if (gratuitySituation.getGratuityValues().getIdInternal().equals(gratuityValuesID)) {					return gratuitySituation;				}			}		}		return null;	}