//make sure that only last returned item can be removed.
if(fLastReturnedItem == fAttributes[fCurrent - 1]){
//remove the attribute at current index and lower the current position by 1.
removeAttributeAt(fCurrent--) ;
}
else {
//either the next method has been called yet, or the remove method has already been called
//after the last call to the next method.
throw new IllegalStateException();
}