code: private static Map<IAtom, Integer> indexMap(Map<IAtom, Integer> map, IAtomContainer container) {
          if (map != null) return map;
          map = new HashMap<IAtom, Integer>();
          for (IAtom a : container.atoms()) {
              map.put(a, map.size());
          }
          return map;
      }
docs: Lazy creation of an atom index map.
  
  @param map       existing map (possibly null)
  @param container the container we want the map for
  @return a usable atom to index map for the given container