code: public static List<AtomSite> convertGroupToAtomSites(Group g, int model, String chainName, String chainId) {
  
  		// The alt locs can have duplicates, since at parsing time we make sure that all alt loc groups have
  		// all atoms (see StructureTools#cleanUpAltLocs)
  		// Thus we have to remove duplicates here by using the atom id
  		// See issue https://github.com/biojava/biojava/issues/778 and TestAltLocs.testMmcifWritingAllAltlocs/testMmcifWritingPartialAltlocs
  		Map<Integer, AtomSite> uniqueAtomSites = new LinkedHashMap<>();
  
  		int groupsize  = g.size();
  
  		for ( int atompos = 0 ; atompos < groupsize; atompos++) {
  			Atom a = g.getAtom(atompos);
  			if ( a == null)
  				continue ;
  
  			uniqueAtomSites.put(a.getPDBserial(), convertAtomToAtomSite(a, model, chainName, chainId));
  		}
  
  		if ( g.hasAltLoc()){
  			for (Group alt : g.getAltLocs() ) {
  				for (AtomSite atomSite : convertGroupToAtomSites(alt, model, chainName, chainId)) {
  					uniqueAtomSites.put(Integer.parseInt(atomSite.getId()), atomSite);
  				}
  			}
  		}
  		return new ArrayList<>(uniqueAtomSites.values());
  	}
docs: Converts a Group into a List of {@link AtomSite} objects.
  Atoms in other altloc groups (different from the main group) are also included, removing possible duplicates
  via using the atom identifier to assess uniqueness.
  @param g the group
  @param model the model number for the output AtomSites
  @param chainName the chain identifier (author id) for the output AtomSites
  @param chainId the internal chain identifier (asym id) for the output AtomSites
  @return