@Override
    public boolean removeItem(int quantity, MasterDataEntity masterData) {
        String type = masterData.getId();
        
        System.out.println("Type from masterData: " + type);
        for (int i = 1; i < 4; i++) {
            try {
                Rack rack = (Rack) manager.get("R" + i);
                List<IShelf> shelfs = rack.getShelfs();
                for (IShelf iShelf : shelfs) {
                    List<IItem> items = iShelf.getItems();
                    for (int j = 0; j < items.size(); j++) {
                        IItem iItem = items.get(j);
                        System.out.println("Type from item: " + iItem.getType());
                        System.out.println("quantity: " + quantity);
                        System.out.println("amout: " + iItem.getAmount());
                        if (type.equals(iItem.getType()) && (quantity >= iItem.getAmount())) {
                            quantity -= iItem.getAmount();
                            iShelf.removeItem(iItem);
                            System.out.println("Deleting item...rest quantity is: " + quantity);
                        } else if (type.equals(iItem.getType()) && (quantity < iItem.getAmount()) && (quantity > 0)) {
                            IItem newItem = iItem;
                            iShelf.removeItem(iItem);
                            newItem.setAmount(newItem.getAmount() - quantity);
                            iShelf.insertItem(newItem);
                            // iItem.setAmout(iItem.getAmount()- quantity);
                            System.out.println("Change amout...rest quantity is: " + quantity);
                            return true;
                        }
                    }
                }
            } catch (Exception ex) {
                Logger.getLogger(Storage.class.getName()).log(Level.SEVERE, null, ex);
            }
            
        }
        
        return true;
    }