code: @Override
  	public Group findGroup(String chainName, String pdbResnum, int modelnr)
  			throws StructureException {
  
  
  		// if structure is xray there will be only one "model".
  		if ( modelnr > models.size())
  			throw new StructureException(" no model nr " + modelnr +
  					" in this structure. (contains "+models.size()+")");
  
  
  		// first we need to gather all groups with the author id chainName: polymers, non-polymers and waters
  		Chain polyChain = getPolyChainByPDB(chainName, modelnr);
  		if(polyChain != null) {
  			List<Group> groups = new ArrayList<>();
  
  			groups.addAll(polyChain.getAtomGroups());
  
  
  			// there can be more than one non-poly chain for a given author id
  			for (Chain chain: getNonPolyChainsByPDB(chainName, modelnr)) {
  				groups.addAll(chain.getAtomGroups());
  			}
  
  			Chain water = getWaterChainByPDB(chainName, modelnr);
  
  			if (water!=null)
  				groups.addAll(water.getAtomGroups());
  
  
  
  			// now iterate over all groups
  			// in order to find the amino acid that has this pdbRenum.
  
  			for (Group g : groups) {
  				String rnum = g.getResidueNumber().toString();
  				//System.out.println(g + " >" + rnum + "< >" + pdbResnum + "<");
  				// we only mutate amino acids
  				// and ignore hetatoms and nucleotides in this case
  				if (rnum.equals(pdbResnum)) {
  					return g;
  				}
  			}
  		}
  		throw new StructureException("could not find group " + pdbResnum +
  				" in chain " + chainName);
  	}
docs: {@inheritDoc}