Unit newInstitution = (newInstitutionName != null && newInstitutionName.length() > 0) ? new Unit( newInstitutionName, PartyTypeEnum.EXTERNAL_INSTITUTION) : precedentDegreeInformationBean.getInstitution();
Unit newInstitution = (newInstitutionName != null && newInstitutionName.length() > 0) ? Unit.createNewExternalInstitution(newInstitutionName) : precedentDegreeInformationBean.getInstitution();
    public void run(PrecedentDegreeInformationBean precedentDegreeInformationBean) {        String newInstitutionName = precedentDegreeInformationBean.getNewInstitutionName();        Unit newInstitution = (newInstitutionName != null && newInstitutionName.length() > 0) ? new Unit(                newInstitutionName, PartyTypeEnum.EXTERNAL_INSTITUTION)                : precedentDegreeInformationBean.getInstitution();        PrecedentDegreeInformation precedentDegreeInformation = precedentDegreeInformationBean                .getPrecedentDegreeInformation();        if (newInstitution != null) {            precedentDegreeInformation.setInstitution(newInstitution);        }        precedentDegreeInformation.setDegreeDesignation(precedentDegreeInformationBean                .getDegreeDesignation());        precedentDegreeInformation.setConclusionGrade(precedentDegreeInformationBean                .getConclusionGrade());        precedentDegreeInformation.setConclusionYear(precedentDegreeInformationBean.getConclusionYear());        precedentDegreeInformation.setDegreeDesignation(precedentDegreeInformationBean                .getDegreeDesignation());        precedentDegreeInformation.setCountry(precedentDegreeInformationBean.getCountry());    }