import org.junit.Assert;
import org.junit.Test;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;

public class Main {
    @Test
    public void test() throws IOException {
        Assert.assertEquals("image/png", Files.probeContentType(Paths.get("b.png"))); // Passes
        Assert.assertEquals("image/png", Files.probeContentType(Paths.get("a#b.png"))); // Fails
    }
}
