String [] keys0 =a.keySet(). toArray (new String[a.size()]);
Map< String , TreeSet <Integer>> Sub_hash=new HashMap< String, TreeSet <Integer>>();
for(ko = 0 ; ko < keys0 . length ; ko ++) {
Set<Integer> so = test.get( keys0[ko] );
System.out.println(""+so);
for(ko1 = ko+1 ; ko1 < keys0.length; ko1++) {
Set<Integer> so1 = test.get( keys0[ko1] );
boolean tr=so1.retainAll(so);
if(tr && so1.size()>=2) {
Sub_hash. put(keys0[ko]+keys0[ko1], (TreeSet<Integer>) so1);
System.out.println(""+Sub_hash.size()+""+Sub_hash);
}
}}
this is my second post and i dont know how to post neatly the requirement is i have a hash map with keys and values where i need to compare with one key in the map with another key in the map and retain the values and put the result in the sub_hash map but the problem is the original values of the map are changing as the values of the map are updated by the method retainAll(); but when the iteration comes to second key the values are changed completely but the comparison goes like this 2-3,2-4,2-5,2-6,2-7...etc but as the values are changed result is completely erroneous so is there any chance to make it constant like some variable final to the hashmap.