class Pipe extends Observable {

    public synchronized void setValveThreshold(byte threshold) {
        if (threshold > 100 || threshold < 0) {
            throw new IllegalArgumentException("Valve threshold needs to be in range 0 to 100");
        }
        this.threshold = threshold;
        setChanged();
        notifyObservers();
    }

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

}