private void writeObject(ObjectOutputStream s) throws IOException {
  s.defaultWriteObject();
  for (  E e : this) {
    if (e instanceof Serializable) {
      s.writeObject(e);
    }
  }
  s.writeObject(null);
}

private void writeObject ( ObjectOutputStream s ) throws IOException { s . defaultWriteObject ( ) ; for ( E e : this ) { if ( e instanceof Serializable ) { s . writeObject ( e ) ; } } s . writeObject ( null ) ; }
write the listeners to a stream .
