### Question:
Atom { int getIncomingValency() { int v = 0; for (int i = 0, l = bonds.size(); i < l; i++) { v += bonds.get(i).getOrder(); } return v; } Atom(int id, ChemEl chemlEl, Fragment frag);   Atom(ChemEl chemlEl);   }### Answer:
@Test public void testGetIncomingValency() throws StructureBuildingException { assertEquals("No bonds", 0, sBuilder.build("C").getFirstAtom().getIncomingValency()); assertEquals("One bond", 1, sBuilder.build("CC").getFirstAtom().getIncomingValency()); assertEquals("Two bonds", 2, sBuilder.build("C(C)C").getFirstAtom().getIncomingValency()); assertEquals("Double bond", 2, sBuilder.build("C=O").getFirstAtom().getIncomingValency()); assertEquals("Triple bond", 3, sBuilder.build("C#C").getFirstAtom().getIncomingValency()); assertEquals("One bond", 1, sBuilder.build("CC=CC#N").getFirstAtom().getIncomingValency()); }