superiorUnits.add(0, buffer.toString()); superiorUnits.add(1, unitName);
if(size != 0){ superiorUnits.add(0, buffer.toString()); superiorUnits.add(1, unitName); } else{ superiorUnits.add(0, unitName); }
    private void getParentUnitsNames(IUnit unit, IUnit unitBase) {                List superiorUnits = new ArrayList();        String unitName = unitBase.getName();                        unitName = unitBase.getCostCenterCode().toString() + " - " + unitName;                 if (!unit.getTopUnits().isEmpty() && unit.getTopUnits().size() == 1) {                                 superiorUnits.add(0, unit.getTopUnits().get(0).getName());            superiorUnits.add(1, unitName);            setSuperiorUnitsNames(superiorUnits);        }        else{            StringBuffer buffer = new StringBuffer();            int size = unit.getTopUnits().size(), i = 0;            for (IUnit unit2 : unit.getTopUnits()) {                buffer.append(unit2.getName());                i++;                if(i < size){                    buffer.append(" / ");                }            }            superiorUnits.add(0, buffer.toString());            superiorUnits.add(1, unitName);            setSuperiorUnitsNames(superiorUnits);        }                    }