code: private static void extractAtoms(String[] atomNames, List<Chain> chains,
  			List<Atom> atoms) {
  
  		for (Chain c : chains) {
  
  			for (Group g : c.getAtomGroups()) {
  
  				// a temp container for the atoms of this group
  				List<Atom> thisGroupAtoms = new ArrayList<Atom>();
  				// flag to check if this group contains all the requested atoms.
  				boolean thisGroupAllAtoms = true;
  				for (String atomName : atomNames) {
  					Atom a = g.getAtom(atomName);
  
  					if (a == null) {
  						// this group does not have a required atom, skip it...
  						thisGroupAllAtoms = false;
  						break;
  					}
  					thisGroupAtoms.add(a);
  				}
  				if (thisGroupAllAtoms) {
  					// add the atoms of this group to the array.
  					for (Atom a : thisGroupAtoms) {
  						atoms.add(a);
  					}
  				}
  
  			}
  		}
  	}
docs: Adds to the given atoms list, all atoms of groups that contained all
  requested atomNames, i.e. if a group does not contain all of the
  requested atom names, its atoms won't be added.
  
  @param atomNames
  @param chains
  @param atoms