@Test(expected = FileAlreadyExistsException.class) public void newByteChannelFileAlreadyExists() throws IOException { final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider(); final File tempFile = File.createTempFile( "foo", "bar" ); final Path path = GeneralPathImpl.newFromFile( fsProvider.getFileSystem( URI.create( "file:///" ) ), tempFile ); assertThat( path.toFile().exists() ).isTrue(); assertThat( path.toFile() ).isEqualTo( tempFile ); fsProvider.newByteChannel( path, null ); }