how?
how can i make it that the first names (the keys) will stay as they are and the family names (the values) will change? i tried to do something like that (but it takes the same value and sets all the keys to tha same values) : import java.util.*; import java.util.stream.*; public class Main { public static void main(String[] args) { HashMap <String , String> h = new HashMap <>(); h.put ("Rody" , "Ricch"); h.put ("Travis" , "Scott"); ArrayList <String> k = new ArrayList <> (h.keySet()); //takes all the hashmap's keys if (k.size() % 2 == 0){ ArrayList <String> v = new ArrayList <> (h.values()); //takes all the hashmap's values Collections.shuffle(v); //shuffling the values HashMap <Object , Object> NewH = new HashMap <>(); for (Object i : k){ for (Object j : v){ NewH.put (i , j); } } System.out.println(NewH); } //end if statement } }