code: public static String collapse(String name) {
      if (name == null) {
        return null;
      }
      int breakPoint = name.lastIndexOf('.');
      if (breakPoint < 0) {
        return name;
      }
      return collapseQualifier(name.substring(0, breakPoint), true) + name.substring(breakPoint); // includes last '.'
    }
docs: Collapses a name.  Mainly intended for use with classnames, where an example might serve best to explain.
  Imagine you have a class named 'org.hibernate.internal.util.StringHelper'; calling collapse on that
  classname will result in 'o.h.u.StringHelper'.
  
  @param name The name to collapse.
  @return The collapsed name.