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