/** * Creates and returns a deep copy of this object. * * @return a clone of this instance. */ public Object clone() { try { final Specifications ret = (Specifications) super.clone(); final Specification[] specs = this.getSpecifications(); final Specification[] cloned = new Specification[ specs.length ]; for ( int i = specs.length - 1; i >= 0; i-- ) { cloned[i] = (Specification) specs[i].clone(); } ret.setSpecifications( cloned ); return ret; } catch ( final CloneNotSupportedException e ) { throw new AssertionError( e ); } }