Map<String,Integer> hashMap = new HashMap<String, Integer>();
Map<String,Integer> hashMap2 = new HashMap<String, Integer>();
Map<String,Integer> hashMap3 = new HashMap<String, Integer>();
List<Map<String,Integer>> list = new ArrayList<Map<String,Integer>>();
List<Map<String,Integer>> list1 = new ArrayList<Map<String,Integer>>();
List<Map<String, Integer>> list2 = new ArrayList<Map<String,Integer>>();
List<Map<String, Integer>> list3 = new ArrayList<Map<String,Integer>>();
hashMap.put("1", 1);
hashMap.put("2", 2);
hashMap.put("3", 3);
hashMap3.put("1", 1);
hashMap3.put("2", 6);
hashMap3.put("3", 3);
hashMap2.put("1", 4);
hashMap2.put("2", 5);
hashMap2.put("3", 6);
hashMap2.put("test", 3);
list.add(hashMap);
list.add(hashMap2);
list.add(hashMap3);
for (Map<String, Integer> map : list) {
Integer panduan2=map.get("2");
if(panduan2>3||panduan2==6) {
list2.add(map);
System.out.println(list2+"list2------------------------------");
}else {
list3.add(map);

System.out.println(list3+"list3------------------");
}

}
Boolean flag=true;
if(!flag)
{
list1.addAll(list3);
System.out.println(list1+"list1------------------------------");
}else {
list1.addAll(list2);
System.out.println(list1+"list111111111111111111111111111------------------------------");
}