public static <K, V extends Comparable<? super V>> void fout2csv(
			Map<K, V> map, String path) {
		Set<K> set = map.keySet();
		Iterator<K> iterator = set.iterator();
		FileWriter fw = null;

		try {
			fw = new FileWriter(path);
			while (iterator.hasNext()) {
				K key = iterator.next();
				fw.write(key + "," + map.get(key) + "\n");
			}
			fw.close();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				fw.close();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}