private static Degree getDegree(String[] unitAcronyms) throws NonExistingServiceException { Unit unit = getUnit(unitAcronyms, 3); if (!unit.isDegreeUnit()) { throw new NonExistingServiceException(); } Degree degree = unit.getDegree(); return degree; }