void (JDefinedClass aClass) { List<JAnnotationUse> jsonPropertyOrders = aClass.annotations().stream() .filter(it -> it.getAnnotationClass().fullName().equals("com.fasterxml.jackson.annotation.JsonPropertyOrder")) .collect(Collectors.toList()); if (jsonPropertyOrders.size() > 1) { JAnnotationUse first = jsonPropertyOrders.get(0); JAnnotationArrayMember value = (JAnnotationArrayMember)first.getAnnotationMembers().get("value"); for (int i = 1; i < jsonPropertyOrders.size(); i++) { JAnnotationUse toMerge = jsonPropertyOrders.get(1); ((JAnnotationArrayMember)toMerge.getAnnotationMembers().get("value")).annotations() .forEach((JAnnotationValue a) -> addAnnotationValue(value, a)); removeAnnotation(aClass, toMerge); } } }