code: public static boolean isExtension(final String filename, final String extension) {
          if (filename == null) {
              return false;
          }
          if (extension == null || extension.isEmpty()) {
              return indexOfExtension(filename) == NOT_FOUND;
          }
          final String fileExt = getExtension(filename);
          return fileExt.equals(extension);
      }
docs: Checks whether the extension of the filename is that specified.
  <p>
  This method obtains the extension as the textual part of the filename
  after the last dot. There must be no directory separator after the dot.
  The extension check is case-sensitive on all platforms.
  
  @param filename  the filename to query, null returns false
  @param extension  the extension to check for, null or empty checks for no extension
  @return true if the filename has the specified extension