| 302 | return new ArrayList<>(select(size).keySet()); |
| 303 | } |
| 304 | public static void main(String[] args) { |
| 305 | System.out.println(capitals(10)); |
| 306 | System.out.println(names(10)); |
| 307 | System.out.println(new HashMap<>(capitals(3))); |
| 308 | System.out.println( |
| 309 | new LinkedHashMap<>(capitals(3))); |
| 310 | System.out.println(new TreeMap<>(capitals(3))); |
| 311 | System.out.println(new Hashtable<>(capitals(3))); |
| 312 | System.out.println(new HashSet<>(names(6))); |
| 313 | System.out.println(new LinkedHashSet<>(names(6))); |
| 314 | System.out.println(new TreeSet<>(names(6))); |
| 315 | System.out.println(new ArrayList<>(names(6))); |
| 316 | System.out.println(new LinkedList<>(names(6))); |
| 317 | System.out.println(capitals().get("BRAZIL")); |
| 318 | } |
| 319 | } |
| 320 | /* Output: |
| 321 | {ALGERIA=Algiers, ANGOLA=Luanda, BENIN=Porto-Novo, |