public static void copyMethods(CtMethod[] methods, CtClass destination,
			CtClass[] exceptions) {
		CtMethod methodCopy = null;
		for (CtMethod method : methods) {
			try {
				methodCopy = new CtMethod(method, destination, null);
				if (exceptions != null) {
					try {
						methodCopy.setExceptionTypes(exceptions);
					} catch (NotFoundException e) {
						throw new SLEEException(e.getMessage(),e);
					}
				}
				destination.addMethod(methodCopy);
			} catch (CannotCompileException e) {
				throw new SLEEException(e.getMessage(),e);
			}
		}
	}
public static void copyMethods(CtMethod[] methods, CtClass destination,
			CtClass[] exceptions) {
		CtMethod methodCopy = null;
		for (CtMethod method : methods) {
			try {
				methodCopy = new CtMethod(method, destination, null);
				if (exceptions != null) {
					try {
						methodCopy.setExceptionTypes(exceptions);
					} catch (NotFoundException e) {
						throw new SLEEException(e.getMessage(),e);
					}
				}
				destination.addMethod(methodCopy);
			} catch (CannotCompileException e) {
				throw new SLEEException(e.getMessage(),e);
			}
		}
	}
public static void copyMethods ( CtMethod [ ] methods , CtClass destination , CtClass [ ] exceptions ) { CtMethod methodCopy = null ; for ( CtMethod method : methods ) { try { methodCopy = new CtMethod ( method , destination , null ) ; if ( exceptions != null ) { try { methodCopy . setExceptionTypes ( exceptions ) ; } catch ( NotFoundException e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } } destination . addMethod ( methodCopy ) ; } catch ( CannotCompileException e ) { throw new SLEEException ( e . getMessage ( ) , e ) ; } } }
Copy methods to a class

@param methods
the methods to copy
@param destination
the class to which the methods are copied
@param exceptions
optional, defines the set of exceptions the methods can throw
Copy methods to a class