code: private static @CheckForNull <T extends Descriptor> T findByClassName(Collection<? extends T> list, String className) {
          for (T d : list) {
              if(d.getClass().getName().equals(className))
                  return d;
          }
          return null;
      }
docs: Finds a descriptor from a collection by the class name of the {@link Descriptor}.
  This is useless as of the introduction of {@link #getId} and so only very old compatibility code needs it.