import java.io.IOException;
import java.net.URI;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;

public class JI9060435 {

	public static void main(String[] args) throws Exception {
		// Change this to a local zip file 
		String pathToZip = "D:/Java7Workspace/Tests/out.zip"; 
		URI uri = URI.create("jar:file:///" + pathToZip  + "!/"); 
		Path path = Paths.get(pathToZip); 

		FileSystem a = FileSystems.newFileSystem(path, null); 
		FileSystem b = FileSystems.newFileSystem(uri, Collections.emptyMap()); 

		System.out.println("a == b: " + (a == b)); 
		System.out.println("a: " + a + ", b: " + b); 
		System.out.println("Providers ==: " + (a.provider() == b.provider())); 

		// Creates second FileSystem for the same resource 
		FileSystem a2 = FileSystems.newFileSystem(path, null); 
		System.out.println("a == a2: " + (a == a2)); 

		// Throws FileSystemAlreadyExistsException, as expected 
		FileSystem b2 = FileSystems.newFileSystem(uri, Collections.emptyMap()); 

	}

}
