code: public static String merge(String first, String second) throws ParseException {
      JavaParser.setDoNotAssignCommentsPreceedingEmptyLines(false);
  
      CompilationUnit cu1 = JavaParser.parse(new StringReader(first), true);
      CompilationUnit cu2 = JavaParser.parse(new StringReader(second), true);
      AbstractMerger<CompilationUnit> merger = AbstractMerger.getMerger(CompilationUnit.class);
      CompilationUnit result = merger.merge(cu1, cu2);
      return result.toString();
    }
docs: Util method to make source merge more convenient
  
  @param first  merge params, specifically for the existing source
  @param second merge params, specifically for the new source
  @return merged result
  @throws ParseException cannot parse the input params