return (FoodMatter[]) (itemsToReturn.toArray(returnArrayType));
return (itemsToReturn.toArray(returnArrayType));
    public FoodMatter[] takeFoodMatterMass(float pMass) {        List itemsToReturn = new Vector();        List itemsToRemove = new Vector();        float collectedMass = 0f;        for (Iterator iter = currentFoodItems.iterator(); iter.hasNext()                && (collectedMass <= pMass);) {            FoodMatter currentFoodMatter = (FoodMatter) (iter.next());            float massStillNeeded = pMass - collectedMass;            //we need to get more bio matter            if (currentFoodMatter.mass < massStillNeeded) {                itemsToReturn.add(currentFoodMatter);                itemsToRemove.add(currentFoodMatter);                collectedMass += currentFoodMatter.mass;            }            //we have enough, let's cut up the biomass (if too much)            else if (currentFoodMatter.mass >= massStillNeeded) {                float fractionOfOriginal = massStillNeeded                        / currentFoodMatter.mass;                FoodMatter partialReturnedFoodMatter = new FoodMatter(                        massStillNeeded, currentFoodMatter.waterContent                                * fractionOfOriginal, currentFoodMatter.type);                currentFoodMatter.mass -= partialReturnedFoodMatter.mass;                itemsToReturn.add(partialReturnedFoodMatter);                if (currentFoodMatter.mass <= 0)                    itemsToRemove.add(currentFoodMatter);                collectedMass += partialReturnedFoodMatter.mass;            }        }        //Remove items from List        for (Iterator iter = itemsToRemove.iterator(); iter.hasNext();) {            currentFoodItems.remove(iter.next());        }        currentLevel -= collectedMass;        //return the array        FoodMatter[] returnArrayType = new FoodMatter[0];        return (FoodMatter[]) (itemsToReturn.toArray(returnArrayType));    }