Pipe extends Observable { public boolean isLiquidEntering() { return queue.peekLast() != null && queue.peekLast().getAmount() != 0; } Pipe(float crosssection, int length, byte defaultThreshold); synchronized Liquid putIn(Liquid liquid); synchronized void setValveThreshold(byte threshold); byte getValveThreshold(); float getMaxInput(); synchronized void reset(); boolean isLiquidEntering();  }
@Test public void testIsLiquidEntering() { assertFalse(pipe.isLiquidEntering()); pipe.putIn(new Liquid(pipe.getMaxInput(), SimulationConstants.MIN_TEMPERATURE, new Color(0))); assertTrue(pipe.isLiquidEntering()); pipe.putIn(new Liquid(0, SimulationConstants.MIN_TEMPERATURE, new Color(0))); assertFalse(pipe.isLiquidEntering()); }