Java tutorial
//package com.java2s; import java.util.Map; import java.util.Set; public class Main { public static String getChartsType(Map<String, Long> map) { String TITLE = ""; if (map.isEmpty()) { return null; } Set<String> keySet = map.keySet(); for (String title : keySet) { TITLE += title + ","; } TITLE = TITLE.substring(0, TITLE.length() - 1); return TITLE; } }