public PainterChain prependPainter(Painter p){
  Painter[] newChain=new Painter[chain.length + 1];
  System.arraycopy(chain,1,newChain,0,chain.length);
  newChain[0]=p;
  return new PainterChain(newChain);
}

public PainterChain prependPainter ( Painter p ) { Painter [ ] newChain = new Painter [ chain . length + 1 ] ; System . arraycopy ( chain , 1 , newChain , 0 , chain . length ) ; newChain [ 0 ] = p ; return new PainterChain ( newChain ) ; }
creates a new chain based on the existing chain with the new element added at the beginning
