@Test
public void testPositionAtTheEnd() {

    int count = pipeline.getValves().length;
    MyAuthValve myValve = new MyAuthValve("myAuthValve1", pipeline);
    myValve.afterPropertiesSet();
    assertEquals("Valve count is wrong", count + 1, pipeline.getValves().length);
    assertEquals("Valve is not appended to the end", pipeline.getValves().length - 1, getPosition(myValve.getId()));
    
    // add valve second time
    count = pipeline.getValves().length;
    myValve.afterPropertiesSet();
    assertEquals("Valve count is wrong", count, pipeline.getValves().length);
    assertEquals("Valve is not at the end", count - 1, getPosition(myValve.getId()));
}