if (null == destroyMethod || destroyMethod.isStatic() || destroyMethod.getVisibility() != Visibility.PUBLIC) {
throwCustomMethodNotFound(bean, destroyMethodName);
}
final GeneratorContext context = this.getGeneratorContext();
context.debug("Overriding destroy to call " + destroyMethod + " for bean: " + bean);
final NewType beanFactory = bean.getFactoryBean();
final Method beanFactoryInitMethod = beanFactory.getMostDerivedMethod(Constants.DESTROY, this.getParameterListWithOnlyObject());
final NewMethod newMethod = beanFactoryInitMethod.copy(beanFactory);
newMethod.setAbstract(false);