@Test
public void testCloneAnnotationsAttribute() {

  final CtClass clz = ClassPool.getDefault().makeClass("testCloneAnnotationsAttribute");
  final CtMethod ctmethod = addNewMethod(clz, "origMethod");
  final AnnotationsAttribute attr = annotateMethod(ctmethod, "origAnno", 135);
  final AnnotationsAttribute clonedAttr =
      JavassistUtils.cloneAnnotationsAttribute(
          ctmethod.getMethodInfo().getConstPool(),
          attr,
          java.lang.annotation.ElementType.METHOD);
  Assert.assertEquals(
      135,
      ((IntegerMemberValue) clonedAttr.getAnnotation("java.lang.Integer").getMemberValue(
          "origAnno")).getValue());
}