@SuppressWarnings("unchecked")
    private T createEntity(T entity) {
        try {
            return (T) entity.getClass()
                    .getConstructor(new Class<?>[] { entity.getClass() })
                    .newInstance(entity);
        } catch (IllegalArgumentException e) {

            e.printStackTrace();
        } catch (SecurityException e) {

            e.printStackTrace();
        } catch (InstantiationException e) {

            e.printStackTrace();
        } catch (IllegalAccessException e) {

            e.printStackTrace();
        } catch (InvocationTargetException e) {

            e.printStackTrace();
        } catch (NoSuchMethodException e) {

            e.printStackTrace();
        }

        return null;
    }