public void testUnsupportedRemove(){
  if (isRemoveSupported())   return;
  resetEmpty();
  try {
    collection.clear();
    fail("clear should raise UnsupportedOperationException");
  }
 catch (  UnsupportedOperationException e) {
  }
  verify();
  try {
    collection.remove(null);
    fail("remove should raise UnsupportedOperationException");
  }
 catch (  UnsupportedOperationException e) {
  }
  verify();
  try {
    collection.removeAll(null);
    fail("removeAll should raise UnsupportedOperationException");
  }
 catch (  UnsupportedOperationException e) {
  }
  verify();
  try {
    collection.retainAll(null);
    fail("removeAll should raise UnsupportedOperationException");
  }
 catch (  UnsupportedOperationException e) {
  }
  verify();
  resetFull();
  try {
    Iterator iterator=collection.iterator();
    iterator.next();
    iterator.remove();
    fail("iterator.remove should raise UnsupportedOperationException");
  }
 catch (  UnsupportedOperationException e) {
  }
  verify();
}

public void testUnsupportedRemove ( ) { if ( isRemoveSupported ( ) ) return ; resetEmpty ( ) ; try { collection . clear ( ) ; fail ( "clear should raise UnsupportedOperationException" ) ; } catch ( UnsupportedOperationException e ) { } verify ( ) ; try { collection . remove ( null ) ; fail ( "remove should raise UnsupportedOperationException" ) ; } catch ( UnsupportedOperationException e ) { } verify ( ) ; try { collection . removeAll ( null ) ; fail ( "removeAll should raise UnsupportedOperationException" ) ; } catch ( UnsupportedOperationException e ) { } verify ( ) ; try { collection . retainAll ( null ) ; fail ( "removeAll should raise UnsupportedOperationException" ) ; } catch ( UnsupportedOperationException e ) { } verify ( ) ; resetFull ( ) ; try { Iterator iterator = collection . iterator ( ) ; iterator . next ( ) ; iterator . remove ( ) ; fail ( "iterator.remove should raise UnsupportedOperationException" ) ; } catch ( UnsupportedOperationException e ) { } verify ( ) ; }
if isremovesupported ( ) returns false , tests to see that remove operations raise an unsupportedoperationexception .
