public behaviorrequires c != null;requires c.elementType <: this.elementType;requires !this.containsNull ==> !c.containsNull;assignable theCollection;ensures this.theCollection.equals(\old(this.theCollection).union(c.theCollection));signals_only java.lang.UnsupportedOperationException, java.lang.ClassCastException, java.lang.IllegalArgumentException, java.lang.NullPointerException;signals (java.lang.UnsupportedOperationException) (* this does not support addAll *);signals (java.lang.ClassCastException) (* class of specified element prevents it from being added to this *);signals (java.lang.IllegalArgumentException) (* some aspect of this element prevents it from being added to this *);signals (java.lang.NullPointerException) (* argument contains null elements and this does not support null elements *);

requires 0 <= index&&index < this.size();assignable theCollection;ensures \result == (\old(this.theList.get(index)));ensures this.theList.equals(\old(this.theList.subsequence(0,index)).insertBack(element).concat(\old(this.theList.subsequence(index+1,this.size()))));signals_only java.lang.UnsupportedOperationException, java.lang.ClassCastException, java.lang.NullPointerException, java.lang.IllegalArgumentException;signals (java.lang.UnsupportedOperationException) (* set method not supported by list *);signals (java.lang.ClassCastException) (* class of specified element prevents it from being added to this *);signals (java.lang.NullPointerException) (* element is null and null elements not supported by this *);signals (java.lang.IllegalArgumentException) (* some aspect of element prevents it from being added to this *);

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.