ZsyncUtil { public static Path getPath(URI uri) { try { return Paths.get(uri); } catch (FileSystemNotFoundException e) { return null; } }  static String toHexString(ByteBuffer buffer); static int computeRsum(byte[] block); static int toInt(short x, short y); static long toLong(int x, int y); static short unsigned(byte b); static String computeSha1(ReadableByteChannel channel); static MessageDigest newMD4(); static MessageDigest newSHA1(); static Path getPath(URI uri);  }
@Test public void testGetPath() throws IOException { Path p = Files.createTempFile(null, null); try { assertEquals(p, ZsyncUtil.getPath(p.toUri())); } finally { Files.delete(p); } }
@Test(expected = IllegalArgumentException.class) public void testGetPathIAE() { ZsyncUtil.getPath(URI.create("test")); }
@Test() public void testGetPathNull() { assertNull(ZsyncUtil.getPath(URI.create("http: }