import hlt.language.tools.Misc;

public class CloningTest
{
  static class Foo
    {
      String s;
      int i;
      Bar bar;
      
      Foo (String a, int b, Bar c)
        {
	  s = a;
	  i = b;
	  bar = c;
	}

      public String toString ()
        {
	  return "Foo[s => " + s + ", i => " + i + ", bar => " + bar + "]";
	}	  
    }

  static class Bar
    {
      String s;
      int i;
      
      Bar (String a, int b)
        {
	  s = a;
	  i = b;
	}

      public String toString ()
        {
	  return "Bar[s => " + s + ", i => " + i + "]";
	}	  
    }

  public static void main (String[] args)
    {
      Foo foo = new Foo("foo",1,new Bar("bar",2));

      System.out.println("Original = " + foo + "\n");
      System.out.println("Copy = " + (Foo)Misc.deepClone(foo) + "\n");      
    }
}
