private static String fixImportStatement(String importStatementOnDemand){
  if (importStatementOnDemand.endsWith(".*")) {
    return importStatementOnDemand.substring(0,importStatementOnDemand.length() - 2);
  }
 else {
    boolean hasClassname=StringUtil.hasUpperCaseChar(importStatementOnDemand);
    if (hasClassname) {
      int pos=importStatementOnDemand.lastIndexOf(".");
      return importStatementOnDemand.substring(0,pos);
    }
 else {
      return importStatementOnDemand;
    }
  }
}

private static String fixImportStatement ( String importStatementOnDemand ) { if ( importStatementOnDemand . endsWith ( ".*" ) ) { return importStatementOnDemand . substring ( 0 , importStatementOnDemand . length ( ) - 2 ) ; } else { boolean hasClassname = StringUtil . hasUpperCaseChar ( importStatementOnDemand ) ; if ( hasClassname ) { int pos = importStatementOnDemand . lastIndexOf ( "." ) ; return importStatementOnDemand . substring ( 0 , pos ) ; } else { return importStatementOnDemand ; } } }
fixes the import statement to be returned as packagename only ( without . * or any classname ) . < p / > < br / > example : java . util will be returned as java . util < br / > example : java . util . * will be returned as java . util < br / > example : java . text . simpledateformat will be returned as java . text
