code: public static IAtomContainer skeleton(IAtomContainer src) {
  
          IChemObjectBuilder builder = src.getBuilder();
  
          IAtom[] atoms = new IAtom[src.getAtomCount()];
          IBond[] bonds = new IBond[src.getBondCount()];
  
          for (int i = 0; i < atoms.length; i++) {
              atoms[i] = builder.newInstance(IAtom.class, src.getAtom(i).getAtomicNumber());
          }
          for (int i = 0; i < bonds.length; i++) {
              IBond bond = src.getBond(i);
              int u = src.indexOf(bond.getBegin());
              int v = src.indexOf(bond.getEnd());
              bonds[i] = builder.newInstance(IBond.class, atoms[u], atoms[v]);
          }
  
          IAtomContainer dest = builder.newInstance(IAtomContainer.class, 0, 0, 0, 0);
          dest.setAtoms(atoms);
          dest.setBonds(bonds);
          return dest;
      }
docs: Create a skeleton copy of the provided structure. The skeleton copy is
  similar to an anonymous copy ({@link #anonymise}) except that atom
  elements are preserved. All bonds are converted to single bonds and a
  'clean' atom is created for the input elements. The 'clean' atom has
  unset charge, mass, and hydrogen count.
  
  @param src input structure
  @return the skeleton copy