BondEnergies { public int getEnergies(IAtom sourceAtom, IAtom targetAtom, Order bondOrder) { int dKJPerMol = -1; for (Map.Entry<Integer, BondEnergy> entry : bondEngergies.entrySet()) { BondEnergy bondEnergy = entry.getValue(); String atom1 = bondEnergy.getSymbolFirstAtom(); String atom2 = bondEnergy.getSymbolSecondAtom(); if ((atom1.equalsIgnoreCase(sourceAtom.getSymbol()) && atom2.equalsIgnoreCase(targetAtom.getSymbol())) || (atom2.equalsIgnoreCase(sourceAtom.getSymbol()) && atom1 .equalsIgnoreCase(targetAtom.getSymbol()))) { Order order = bondEnergy.getBondOrder(); if (order.compareTo(bondOrder) == 0) { dKJPerMol = bondEnergy.getEnergy(); } } } return dKJPerMol; } protected  BondEnergies(); synchronized static BondEnergies getInstance(); int getEnergies(IAtom sourceAtom, IAtom targetAtom, Order bondOrder); int getEnergies(String sourceAtom, String targetAtom, Order bondOrder); int getEnergies(IBond bond);  }
@Test public void testGetEnergies() { IAtom sourceAtom = new Atom("C"); IAtom targetAtom = new Atom("C"); Order bondOrder = Order.SINGLE; BondEnergies instance = new BondEnergies(); Integer expResult = 346; Integer result = instance.getEnergies(sourceAtom, targetAtom, bondOrder); Assert.assertEquals(expResult, result); }