code: public static DependsOn findAllowedByName(final List<DependsOn> allowed, final String pkgName) {
          if (allowed == null) {
              return null;
          }
          Utils4J.checkNotNull("pkgName", pkgName);
          for (int i = 0; i < allowed.size(); i++) {
              final DependsOn dep = allowed.get(i);
              if (pkgName.startsWith(dep.getPackageName())) {
                  if (dep.isIncludeSubPackages()) {
                      return dep;
                  } else {
                      if (pkgName.equals(dep.getPackageName())) {
                          return dep;
                      }
                  }
              }
          }
          return null;
      }
docs: Find a dependency in a list by a package name.
  
  @param allowed
  List to search.
  @param pkgName
  Name of the package to find - Cannot be <code>null</code>.
  
  @return Entry or <code>null</code> if nothing was found.