code: public final void validate() throws InvalidDependenciesDefinitionException {
  
          int errorCount = 0;
          final StringBuilder sb = new StringBuilder("Duplicate package entries in 'allowed' and 'forbidden': ");
          final List<Package<NotDependsOn>> list = getForbidden();
          for (int i = 0; i < list.size(); i++) {
              final String name = list.get(i).getName();
              final Package<DependsOn> dep = new Package<DependsOn>(name);
              if (getAllowed().indexOf(dep) > -1) {
                  if (errorCount > 0) {
                      sb.append(", ");
                  }
                  sb.append(name);
                  errorCount++;
              }
          }
          if (errorCount > 0) {
              throw new InvalidDependenciesDefinitionException(this, sb.toString());
          }
      }
docs: Checks if the definition is valid - Especially if no package is in both lists.
  
  @throws InvalidDependenciesDefinitionException
  This instance is invalid.