public static String generateHostName(String vmName,String hostId){
  String hostname=vmName + '-' + hostId;
  Preconditions.checkState(hostname.equals(hostname.toLowerCase()),"hostname should not contain upper case characters");
  return hostname;
}

public static String generateHostName ( String vmName , String hostId ) { String hostname = vmName + '-' + hostId ; Preconditions . checkState ( hostname . equals ( hostname . toLowerCase ( ) ) , "hostname should not contain upper case characters" ) ; return hostname ; }
generates the hostname for a node .
