public static String findLongestString(  HashSet<String> dict ,int len){
System.out.println("FL-len:"+len);		
		Iterator<String> iterator = dict.iterator();
		String longestStr = "";
		int i=0;
		boolean getOne = false;
		while(iterator.hasNext()){
			String tmp = (String)iterator.next();
System.out.println("DICT:"+tmp );
			if(i==0){
				if(tmp.length() < len){
					getOne = true;
					longestStr = tmp;
					//dict.remove(tmp);
				}
			}else{
				if(tmp.length() < len && tmp.length() > longestStr.length()){
					getOne = true;
					longestStr = tmp;
					//dict.remove(tmp);
				}
			}
			i++;
		}
		if(getOne){
			dict.remove(longestStr);
			return longestStr;
		}else{
			return null;
		}
	}