private static List<String> addImport(List<String> lines,Class<?> aClass,Class<?> classToImport){
  if (existImport(lines,classToImport))   return lines;
  List<String> result=new ArrayList<String>();
  for (  String line : lines) {
    result.add(line);
    if (!packageFound(line,aClass))     continue;
    result.add("import " + classToImport.getName() + ";");
  }
  return result;
}

private static List < String > addImport ( List < String > lines , Class < ? > aClass , Class < ? > classToImport ) { if ( existImport ( lines , classToImport ) ) return lines ; List < String > result = new ArrayList < String > ( ) ; for ( String line : lines ) { result . add ( line ) ; if ( ! packageFound ( line , aClass ) ) continue ; result . add ( "import " + classToImport . getName ( ) + ";" ) ; } return result ; }
adds jmap import to the lines .
