package main.java.test; import org.testng.Assert; import java.net.URLPermission; public class Test { public static void main(String[] args) { /** * Example 1: "If header-names is empty then the colon separator will not be present." */ Assert.assertTrue(new URLPermission("http://www.oracle.com", "GET").getActions() .chars().mapToObj(i -> (char) i).noneMatch((Character c) -> c.charValue() == ':')); //java.lang.AssertionError: expected: but was: /** * Example 2: * Returns the normalized method list and request header list, in the form: * "method-names : header-names" *

* where method-names is the list of methods separated by commas and header-names is the list of permitted headers separated by commas. */ Assert.assertEquals(new URLPermission("http://www.oracle.com", "GET,DELETE:X-Foo-Request,X-Bar-Request").getActions(), "GET,DELETE:X-Foo-Request,X-Bar-Request"); //java.lang.AssertionError: expected: but was: } }