public static final List<Map<String, Object>> getRequirementsGroupedByReqSpecMap(List<Requirement> requirements) {
List<Map<String, Object>> requirementsGroupedByReqSpecMap = new ArrayList<Map<String, Object>>();
Map<Integer, List<Integer>> tempMap = new HashMap<Integer, List<Integer>>();
for (Iterator<Requirement> iterator = requirements.iterator(); iterator.hasNext();) {
Requirement requirement = iterator.next();
List<Integer> requirementsArray = tempMap.get(requirement.getReqSpecId());
if (requirementsArray == null) {
requirementsArray = new ArrayList<Integer>();
}
requirementsArray.add(requirement.getId());
tempMap.put(requirement.getReqSpecId(), requirementsArray);
}
Set<Entry<Integer, List<Integer>>> entrySet = tempMap.entrySet();
for (Entry<Integer, List<Integer>> entry : entrySet) {