TankSimulation extends Tank { public void putIn(Liquid input) { LinkedList<Liquid> liquids = new LinkedList<>(); liquids.add(this.getLiquid()); liquids.add(input); this.setLiquid(mixingStrategy.mixLiquids(liquids)); } TankSimulation(float capacity, TankSelector tankSelector, Liquid liquid, Pipe outPipe, Pipe inPipe); void putIn(Liquid input); Liquid takeOut(float amount);  }
@Test public void testPutIn() { Liquid content = new Liquid(100, 350, new Color(0x004000)); TankSimulation tank = new TankSimulation(1000, TankSelector.valuesWithoutMix()[0], content, pipe1, pipe2); tank.putIn(new Liquid(100, 310, new Color(0x800020))); assertEquals(new Liquid(200, 330, new Color(0x402010)), tank.getLiquid()); }