code: public static boolean movies(final MovieInfo moviedb, final String title, final String year, int maxDistance, boolean caseSensitive) {
          if ((moviedb == null) || (StringUtils.isBlank(title))) {
              return false;
          }
  
          String primaryTitle, firstCompareTitle, secondCompareTitle;
          if (caseSensitive) {
              primaryTitle = title;
              firstCompareTitle = moviedb.getOriginalTitle();
              secondCompareTitle = moviedb.getTitle();
          } else {
              primaryTitle = title.toLowerCase();
              firstCompareTitle = moviedb.getTitle().toLowerCase();
              secondCompareTitle = moviedb.getOriginalTitle().toLowerCase();
          }
  
          if (isValidYear(year) && isValidYear(moviedb.getReleaseDate())) {
              // Compare with year
              String movieYear = moviedb.getReleaseDate().substring(0, YEAR_LENGTH);
              return movieYear.equals(year) && compareTitles(primaryTitle, firstCompareTitle, secondCompareTitle, maxDistance);
          }
  
          // Compare without year
          return compareTitles(primaryTitle, firstCompareTitle, secondCompareTitle, maxDistance);
      }
docs: Compare the MovieDB object with a title and year
  
  @param moviedb The moviedb object to compare too
  @param title The title of the movie to compare
  @param year The year of the movie to compare
  @param maxDistance The Levenshtein Distance between the two titles. 0 =
  exact match
  @param caseSensitive true if the comparison is to be case sensitive
  @return True if there is a match, False otherwise.