code: public String detectMimeType(String filename, Callable<byte[]> getBytes) throws GetBytesException {
  	    Supplier<CompletionStage<byte[]>> supplier = () -> {
  	        try {
  	            return CompletableFuture.completedFuture(getBytes.call());
              } catch (Exception ex) {
                  throw new CompletionException(ex);
              }
          };
          return unwrapFutureString(detectMimeTypeAsync(filename, supplier));
      }
docs: Synchronously detects a MIME type from a filename and bytes.
  
  <p>
  This method follows the Shared Mime Info database's
  <a href="http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html#idm140625828606432">Recommended
  Checking Order</a>. The only difference: it tests for
  <tt>text/plain</tt> thoroughly, both by scanning more of the file and
  by supporting many character sets.
  </p>
  
  <p>
  getBytes() is a {@link java.util.concurrent.Callable} because it may or
  may not be needed. A file named <tt>README</tt> will always be detected
  as <tt>text/plain</tt>, for instance; a file named <tt>foo.doc</tt>
  will need a magic-number check because it may be plain text or it may be
  a Word document.
  </p>
  
  <p>
  If you are creating your own {@code getBytes} method, ensure its return
  value is unpadded. (Use {@link java.util.Arrays#copyOf(byte[],int)} to truncate
  it.) It needn't be any longer than {@link #getMaxGetBytesLength()}
  bytes.
  </p>
  
  @param filename Filename. To skip filename globbing, pass {@literal ""}
  @param getBytes Callable that returns a {@code byte[]}
  @return a MIME type such as {@literal "text/plain"}
  @throws GetBytesException if {@code getBytes.call()} throws an Exception