code: @Override
      public DescriptorValue calculate(IAtomContainer atomContainer) {
  
          if (checkRingSystem)
              Cycles.markRingAtomsAndBonds(atomContainer);
  
          // make a subset molecule only including acyclic non-hydrogen atoms
          final Set<IAtom> included = new HashSet<>();
          for (IAtom atom : atomContainer.atoms()) {
              if (!atom.isInRing() && atom.getAtomicNumber() != 1)
                  included.add(atom);
          }
          IAtomContainer subset = subsetMol(atomContainer, included);
  
          AllPairsShortestPaths apsp = new AllPairsShortestPaths(subset);
  
          int max = 0;
          int numAtoms = subset.getAtomCount();
          for (int i = 0; i < numAtoms; i++) {
              for (int j = i+1; j < numAtoms; j++) {
                  int len = apsp.from(i).pathTo(j).length;
                  if (len > max)
                      max = len;
              }
          }
  
          return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
                  max), getDescriptorNames());
      }
docs: Calculate the count of atoms of the largest chain in the supplied {@link IAtomContainer}.
  
  @param atomContainer The {@link IAtomContainer} for which this descriptor is to be calculated
  @return the number of atoms in the largest chain of this AtomContainer
  @see #setParameters