code: private static IAtomContainer makeAlkane(int chainLength) {
          IAtomContainer currentChain = new AtomContainer();
  
          //Add the initial atom
          currentChain.addAtom(new Atom("C"));
  
          //Add further atoms and bonds as needed, a pair at a time.
          for (int atomCount = 1; atomCount < chainLength; atomCount++) {
              currentChain.addAtom(new Atom("C"));
              currentChain.addBond(atomCount, atomCount - 1, IBond.Order.SINGLE);
          }
  
          return currentChain;
      }
docs: Generate an Alkane (chain of carbons with no hydrogens) of a given length.
  
  <p>This method was written by Stephen Tomkinson.
  
  @param chainLength The number of carbon atoms to have in the chain.
  @return A molecule containing a bonded chain of carbons.
  
  @cdk.created 2003-08-15