code: private boolean fileNameMatch(Dependency dependency1, Dependency dependency2) {
          if (dependency1 == null || dependency1.getFileName() == null
                  || dependency2 == null || dependency2.getFileName() == null) {
              return false;
          }
          final String fileName1 = dependency1.getActualFile().getName();
          final String fileName2 = dependency2.getActualFile().getName();
  
          //version check
          final DependencyVersion version1 = DependencyVersionUtil.parseVersion(fileName1);
          final DependencyVersion version2 = DependencyVersionUtil.parseVersion(fileName2);
          if (version1 != null && version2 != null && !version1.equals(version2)) {
              return false;
          }
  
          //filename check
          final Matcher match1 = STARTING_TEXT_PATTERN.matcher(fileName1);
          final Matcher match2 = STARTING_TEXT_PATTERN.matcher(fileName2);
          if (match1.find() && match2.find()) {
              return match1.group().equals(match2.group());
          }
  
          return false;
      }
docs: Returns true if the file names (and version if it exists) of the two
  dependencies are sufficiently similar.
  
  @param dependency1 a dependency2 to compare
  @param dependency2 a dependency2 to compare
  @return true if the identifiers in the two supplied dependencies are
  equal