code: private void addBonds(Atom atom, List<Atom> atomsInGroup, List<Atom> allAtoms) {
  		if(atom.getBonds()==null){
  			return;
  		}
  		for(Bond bond : atom.getBonds()) {
  			// Now set the bonding information.
  			Atom other = bond.getOther(atom);
  			// If both atoms are in the group
  			if (atomsInGroup.indexOf(other)!=-1){
  				Integer firstBondIndex = atomsInGroup.indexOf(atom);
  				Integer secondBondIndex = atomsInGroup.indexOf(other);
  				// Don't add the same bond twice
  				if(firstBondIndex>secondBondIndex){
  					int bondOrder = bond.getBondOrder();
  					mmtfDecoderInterface.setGroupBond(firstBondIndex, secondBondIndex, bondOrder);
  				}
  			}
  			// Otherwise it's an inter group bond - so add it here
  			else {
  				Integer firstBondIndex = allAtoms.indexOf(atom);
  				Integer secondBondIndex = allAtoms.indexOf(other);
  				if(firstBondIndex>secondBondIndex){
  					// Don't add the same bond twice
  					int bondOrder = bond.getBondOrder();
  					mmtfDecoderInterface.setInterGroupBond(firstBondIndex, secondBondIndex, bondOrder);
  				}
  			}
  		}
  	}
docs: Add the bonds for a given atom.
  @param atom the atom for which bonds are to be formed
  @param atomsInGroup the list of atoms in the group
  @param allAtoms the list of atoms in the whole structure