switch (getActiveSituation().getAcademicServiceRequestSituationType()) { case PROCESSING: acceptedTypes = new AcademicServiceRequestSituationType[] { AcademicServiceRequestSituationType.CANCELLED, AcademicServiceRequestSituationType.REJECTED, AcademicServiceRequestSituationType.CONCLUDED }; break; case CONCLUDED: acceptedTypes = new AcademicServiceRequestSituationType[] { AcademicServiceRequestSituationType.DELIVERED }; break; default: acceptedTypes = new AcademicServiceRequestSituationType[] {}; break; }  if (!Arrays.asList(acceptedTypes).contains(academicServiceRequestSituationType)) { final LabelFormatter sourceLabelFormatter = new LabelFormatter().appendLabel( getActiveSituation().getAcademicServiceRequestSituationType().name(), "enum");
if (!acceptedTypes.contains(academicServiceRequestSituationType)) { final LabelFormatter sourceLabelFormatter = new LabelFormatter() .appendLabel(getActiveSituation().getAcademicServiceRequestSituationType() .getQualifiedName(), "enum");
    private void checkRulesToChangeState(            AcademicServiceRequestSituationType academicServiceRequestSituationType) {        AcademicServiceRequestSituationType[] acceptedTypes;        if (getActiveSituation() != null) {            switch (getActiveSituation().getAcademicServiceRequestSituationType()) {            case PROCESSING:                acceptedTypes = new AcademicServiceRequestSituationType[] {                        AcademicServiceRequestSituationType.CANCELLED,                        AcademicServiceRequestSituationType.REJECTED,                        AcademicServiceRequestSituationType.CONCLUDED };                break;            case CONCLUDED:                acceptedTypes = new AcademicServiceRequestSituationType[] { AcademicServiceRequestSituationType.DELIVERED };                break;            default:                acceptedTypes = new AcademicServiceRequestSituationType[] {};                break;            }            if (!Arrays.asList(acceptedTypes).contains(academicServiceRequestSituationType)) {                final LabelFormatter sourceLabelFormatter = new LabelFormatter().appendLabel(                        getActiveSituation().getAcademicServiceRequestSituationType().name(), "enum");                final LabelFormatter targetLabelFormatter = new LabelFormatter().appendLabel(                        academicServiceRequestSituationType.name(), "enum");                throw new DomainExceptionWithLabelFormatter(                        "error.serviceRequests.AcademicServiceRequest.cannot.change.from.source.state.to.target.state",                        sourceLabelFormatter, targetLabelFormatter);            }        } else {            acceptedTypes = new AcademicServiceRequestSituationType[] {                    AcademicServiceRequestSituationType.CANCELLED,                    AcademicServiceRequestSituationType.PROCESSING };            if (!Arrays.asList(acceptedTypes).contains(academicServiceRequestSituationType)) {                final LabelFormatter labelFormatter = new LabelFormatter().appendLabel(                        academicServiceRequestSituationType.name(), "enum");                throw new DomainExceptionWithLabelFormatter(                        "error.serviceRequests.AcademicServiceRequest.cannot.change.state.",                        labelFormatter);            }        }    }