private static void createNodeVsBlockMapping(List<NodeBlockRelation> flattenedList,Map<String,List<Distributable>> nodeAndBlockMapping){
  for (  NodeBlockRelation nbr : flattenedList) {
    String node=nbr.getNode();
    List<Distributable> list;
    if (null == nodeAndBlockMapping.get(node)) {
      list=new ArrayList<>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
      list.add(nbr.getBlock());
      Collections.sort(list);
      nodeAndBlockMapping.put(node,list);
    }
 else {
      list=nodeAndBlockMapping.get(node);
      list.add(nbr.getBlock());
      Collections.sort(list);
    }
  }
}

private static void createNodeVsBlockMapping ( List < NodeBlockRelation > flattenedList , Map < String , List < Distributable > > nodeAndBlockMapping ) { for ( NodeBlockRelation nbr : flattenedList ) { String node = nbr . getNode ( ) ; List < Distributable > list ; if ( null == nodeAndBlockMapping . get ( node ) ) { list = new ArrayList < > ( CarbonCommonConstants . DEFAULT_COLLECTION_SIZE ) ; list . add ( nbr . getBlock ( ) ) ; Collections . sort ( list ) ; nodeAndBlockMapping . put ( node , list ) ; } else { list = nodeAndBlockMapping . get ( node ) ; list . add ( nbr . getBlock ( ) ) ; Collections . sort ( list ) ; } } }
create the node and its related blocks mapping and put in a map
