if (unit.getType() != null && unit.getType().equals(PartyType.DEPARTMENT)
if (unit.getType() != null && unit.getType().equals(PartyTypeEnum.DEPARTMENT)
    private boolean unitDepartment(Unit unit) {        if (unit.getType() != null && unit.getType().equals(PartyType.DEPARTMENT)                && unit.getDepartment() != null) {            return true;        }        return false;    }