code: private boolean isBonded(int i, int j) {
  
  		SecStrucState one = getSecStrucState(i);
  		SecStrucState two = getSecStrucState(j);
  
  		double don1e = one.getDonor1().getEnergy();
  		double don2e = one.getDonor2().getEnergy();
  		double acc1e = two.getAccept1().getEnergy();
  		double acc2e = two.getAccept2().getEnergy();
  
  		int don1p = one.getDonor1().getPartner();
  		int don2p = one.getDonor2().getPartner();
  		int acc1p = two.getAccept1().getPartner();
  		int acc2p = two.getAccept2().getPartner();
  
  		//Either donor from i is j, or accept from j is i
  		boolean hbond = (don1p == j && don1e < HBONDHIGHENERGY) ||
  				(don2p == j && don2e < HBONDHIGHENERGY) ||
  				(acc1p == i && acc1e < HBONDHIGHENERGY) ||
  				(acc2p == i && acc2e < HBONDHIGHENERGY);
  
  		if (hbond){
  			logger.debug("*** H-bond from CO of {} to NH of {}", i, j);
  			return true;
  		}
  		return false ;
  	}
docs: Test if two groups are forming an H-Bond. The bond tested is
  from the CO of group i to the NH of group j. Acceptor (i) and
  donor (j). The donor of i has to be j, and the acceptor of j
  has to be i.
  DSSP defines H-Bonds if the energy < -500 cal/mol.
  
  @param i group one
  @param j group two
  @return flag if the two are forming an Hbond