public void addChild(PdfLayer childLayer){
  if (childLayer.parent != null)   throw new IllegalArgumentException("Illegal argument: childLayer");
  childLayer.parent=this;
  if (children == null)   children=new ArrayList<>();
  children.add(childLayer);
}

public void addChild ( PdfLayer childLayer ) { if ( childLayer . parent != null ) throw new IllegalArgumentException ( "Illegal argument: childLayer" ) ; childLayer . parent = this ; if ( children == null ) children = new ArrayList < > ( ) ; children . add ( childLayer ) ; }
adds a child layer . nested layers can only have one parent .
