private int encodeUniquePath(IAtomContainer container, Map<IAtom, List<IBond>> cache, List<IAtom> path, StringBuilder buffer) { if (path.size() == 1) return getAtomSymbol(path.get(0)).hashCode(); String forward = encodePath(container, cache, path, buffer); Collections.reverse(path); String reverse = encodePath(container, cache, path, buffer); Collections.reverse(path); final int x; if (reverse.compareTo(forward) < 0) x = forward.hashCode(); else x = reverse.hashCode(); return x; }