how to use hashset and to get value and key code example Example: place values in a hashset Set<String> set = new HashSet<>(Arrays.asList("a", "b", "c"));