// Path: src/test/java/jigspuzzle/testutils/factories/FactorySlave.java
// public class FactorySlave {
// 
//     /**
//      * Builds a new Instance from the given class with default attributes as
//      * defined in a separate factory.
//      *
//      * A factory is given in this package with the name of the given class and
//      * adding 'Factory' to the end. E.g: the factory for
//      * <code>build(MyClass.class)</code> has the name MyClassFactory.
//      *
//      * @param classToBuild
//      * @return
//      * @throws ClassNotFoundException
//      */
//     public static FactorySlave build(Class<?> classToBuild) throws ClassNotFoundException {
//         // find factory for this class
//         Class<?> factoryClass;
// 
//         try {
//             factoryClass = Class.forName(FactorySlave.class.getPackage().getName() + "." + classToBuild.getSimpleName() + "Factory");
//         } catch (ClassNotFoundException ex) {
//             throw new ClassNotFoundException("Cannot find the factory for class: " + classToBuild.toString());
//         }
// 
//         // instanciate factory
//         AbstractFactory factoryInstance;
// 
//         try {
//             factoryInstance = (AbstractFactory) factoryClass.getDeclaredConstructor().newInstance();
//         } catch (Exception ex) {
//             throw new ClassNotFoundException("Cannot create an instance of the factory " + factoryClass.toString());
//         }
// 
//         //let factory create an object
//         Object createdObject;
// 
//         try {
//             createdObject = factoryInstance.createObject();
//         } catch (Exception ex) {
//             throw new ClassNotFoundException("The factory could not create an instance", ex);
//         }
// 
//         return new FactorySlave(classToBuild, createdObject);
//     }
// 
//     /**
//      * The class, that this factory should build.
//      */
//     private Class<?> classToBuild;
// 
//     /**
//      * The object, that is created within this factory slave.
//      */
//     private Object createdObject;
// 
//     private FactorySlave(Class<?> classToBuild, Object createdObject) {
//         this.classToBuild = classToBuild;
//         this.createdObject = createdObject;
//     }
// 
//     /**
//      * Creates the object and returns it.
//      *
//      * @return
//      */
//     public Object create() {
//         return createdObject;
//     }
// 
//     /**
//      * Sets the given attribute to the given value in the created object.
//      *
//      * @param attribute
//      * @param value
//      * @return
//      * @throws NoSuchFieldException
//      */
//     public FactorySlave withAttribut(String attribute, Object value) throws NoSuchFieldException {
//         Class<?> clazz = classToBuild;
//         while (clazz != null) {
//             try {
//                 Field field = clazz.getDeclaredField(attribute);
//                 field.setAccessible(true);
//                 field.set(createdObject, value);
//                 return this;
//             } catch (NoSuchFieldException e) {
//                 clazz = clazz.getSuperclass();
//             } catch (Exception e) {
//                 throw new IllegalStateException(e);
//             }
//         }
// 
//         // no attribute found
//         throw new NoSuchFieldException();
//     }
// 
// }


import jigspuzzle.testutils.factories.FactorySlave;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
package jigspuzzle.model.puzzle;


public class PuzzlepieceConnectionIT {

    public PuzzlepieceConnectionIT() {
    }

    @BeforeClass
    public static void setUpClass() {
    }

    @AfterClass
    public static void tearDownClass() {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    @Test
    public void testConvertPuzzlepieceConnections() throws ClassNotFoundException {
// Path: src/test/java/jigspuzzle/testutils/factories/FactorySlave.java
// public class FactorySlave {
// 
//     /**
//      * Builds a new Instance from the given class with default attributes as
//      * defined in a separate factory.
//      *
//      * A factory is given in this package with the name of the given class and
//      * adding 'Factory' to the end. E.g: the factory for
//      * <code>build(MyClass.class)</code> has the name MyClassFactory.
//      *
//      * @param classToBuild
//      * @return
//      * @throws ClassNotFoundException
//      */
//     public static FactorySlave build(Class<?> classToBuild) throws ClassNotFoundException {
//         // find factory for this class
//         Class<?> factoryClass;
// 
//         try {
//             factoryClass = Class.forName(FactorySlave.class.getPackage().getName() + "." + classToBuild.getSimpleName() + "Factory");
//         } catch (ClassNotFoundException ex) {
//             throw new ClassNotFoundException("Cannot find the factory for class: " + classToBuild.toString());
//         }
// 
//         // instanciate factory
//         AbstractFactory factoryInstance;
// 
//         try {
//             factoryInstance = (AbstractFactory) factoryClass.getDeclaredConstructor().newInstance();
//         } catch (Exception ex) {
//             throw new ClassNotFoundException("Cannot create an instance of the factory " + factoryClass.toString());
//         }
// 
//         //let factory create an object
//         Object createdObject;
// 
//         try {
//             createdObject = factoryInstance.createObject();
//         } catch (Exception ex) {
//             throw new ClassNotFoundException("The factory could not create an instance", ex);
//         }
// 
//         return new FactorySlave(classToBuild, createdObject);
//     }
// 
//     /**
//      * The class, that this factory should build.
//      */
//     private Class<?> classToBuild;
// 
//     /**
//      * The object, that is created within this factory slave.
//      */
//     private Object createdObject;
// 
//     private FactorySlave(Class<?> classToBuild, Object createdObject) {
//         this.classToBuild = classToBuild;
//         this.createdObject = createdObject;
//     }
// 
//     /**
//      * Creates the object and returns it.
//      *
//      * @return
//      */
//     public Object create() {
//         return createdObject;
//     }
// 
//     /**
//      * Sets the given attribute to the given value in the created object.
//      *
//      * @param attribute
//      * @param value
//      * @return
//      * @throws NoSuchFieldException
//      */
//     public FactorySlave withAttribut(String attribute, Object value) throws NoSuchFieldException {
//         Class<?> clazz = classToBuild;
//         while (clazz != null) {
//             try {
//                 Field field = clazz.getDeclaredField(attribute);
//                 field.setAccessible(true);
//                 field.set(createdObject, value);
//                 return this;
//             } catch (NoSuchFieldException e) {
//                 clazz = clazz.getSuperclass();
//             } catch (Exception e) {
//                 throw new IllegalStateException(e);
//             }
//         }
// 
//         // no attribute found
//         throw new NoSuchFieldException();
//     }
// 
// }


// Path: src/test/java/jigspuzzle/model/puzzle/PuzzlepieceConnectionIT.java
import jigspuzzle.testutils.factories.FactorySlave;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

package jigspuzzle.model.puzzle;


public class PuzzlepieceConnectionIT {

    public PuzzlepieceConnectionIT() {
    }

    @BeforeClass
    public static void setUpClass() {
    }

    @AfterClass
    public static void tearDownClass() {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    @Test
    public void testConvertPuzzlepieceConnections() throws ClassNotFoundException {
        Puzzlepiece piece1 = (Puzzlepiece) FactorySlave.build(Puzzlepiece.class).create();