clone() публичный Метод

public clone ( ) : ModelCreator
Результат ModelCreator
Пример #1
0
 public void test_ModelCreator_clone()
 {
     ModelCreator mc = new ModelCreator();
       mc.setFamilyName("Keating");
       mc.setEmail("*****@*****.**");
       assertTrue( mc.getFamilyName() ==  "Keating" );
       assertTrue( mc.getEmail() ==  "*****@*****.**" );
       ModelCreator mc2 = (ModelCreator) mc.clone();
       assertTrue( mc2.getFamilyName() ==  "Keating" );
       assertTrue( mc2.getEmail() ==  "*****@*****.**" );
       mc2 = null;
       mc = null;
 }