public String map(String in){
  int lin=in.lastIndexOf('/');
  String className=lin == -1 ? in : in.substring(lin + 1);
  if (lin == -1) {
    return map.getOrDefault(in,in);
  }
 else {
    String newClassName=map.getOrDefault(in,className);
    int nlin=newClassName.lastIndexOf('/');
    newClassName=nlin == -1 ? newClassName : newClassName.substring(nlin + 1);
    return mapPackage(in.substring(0,lin)) + "/" + newClassName;
  }
}

public String map ( String in ) { int lin = in . lastIndexOf ( '/' ) ; String className = lin == - 1 ? in : in . substring ( lin + 1 ) ; if ( lin == - 1 ) { return map . getOrDefault ( in , in ) ; } else { String newClassName = map . getOrDefault ( in , className ) ; int nlin = newClassName . lastIndexOf ( '/' ) ; newClassName = nlin == - 1 ? newClassName : newClassName . substring ( nlin + 1 ) ; return mapPackage ( in . substring ( 0 , lin ) ) + "/" + newClassName ; } }
map type name to the new name . subclasses can override .
