class Pipe extends Observable {

    public synchronized Liquid putIn(Liquid liquid) {
        if (liquid.getAmount() > getMaxInput()) {
            throw new OverfullLiquidContainerException("To much liquid inserted into the pipe",
                    getMaxInput(), liquid.getAmount());
        }
        queue.addLast(liquid);
        setChanged();
        if (queue.size() <= length) {
            notifyObservers();
            /* Pipe not filled */
            return new Liquid(0, SimulationConstants.MIN_TEMPERATURE, new Color(0));
        } else {
            Liquid ret = queue.removeFirst();
            notifyObservers();
            return ret;
        }
    }

    public  Pipe(float crosssection, int length, byte defaultThreshold);

}