{
if( !predicate.evaluate( object ) ) {
throw new IllegalArgumentException( "Element " + object + " does not satisfy predicate " + predicate );
}
MutableInteger mutableInteger;
// check for insertion at end
if( index == indices.size() ) {
mutableInteger = new MutableInteger( delegate.size() );
} else {
mutableInteger = new MutableInteger( (MutableInteger) indices.get( index ) );
}
// add to the wrapped list first, so that if it throws an
// exception, we haven't changed the index list yet
delegate.add( mutableInteger.value, object );