我正在创建一个单词比较类,它也会计算单词的出现次数。(这是Java)这是我原来的方法:/***@parammapThemapofwordstosearch*@paramnumThenumberofwordsyouwantprinted*@returnlistofwords*/publicstaticListfindMaxOccurrence(Mapmap,intnum){Listl=newArrayList();for(Map.Entryentry:map.entrySet())l.add(newWordComparable(entry.getKey(),entry.getValue(