code: public static boolean similarPackages(String packName1, String packName2, int depth) {
          if (depth == 0) {
              return true;
          }
  
          String dottedPackName1 = packName1.replace('/', '.');
          String dottedPackName2 = packName2.replace('/', '.');
  
          int dot1 = dottedPackName1.indexOf('.');
          int dot2 = dottedPackName2.indexOf('.');
          if (dot1 < 0) {
              return (dot2 < 0);
          } else if (dot2 < 0) {
              return false;
          }
  
          String s1 = dottedPackName1.substring(0, dot1);
          String s2 = dottedPackName2.substring(0, dot2);
  
          if (!s1.equals(s2)) {
              return false;
          }
  
          return similarPackages(dottedPackName1.substring(dot1 + 1), dottedPackName2.substring(dot2 + 1), depth - 1);
      }
docs: returns whether or not the two packages have the same first 'depth' parts, if they exist
  
  @param packName1
  the first package to check
  @param packName2
  the second package to check
  @param depth
  the number of package parts to check
  
  @return if they are similar