### Question:
PermissionFactory { public static Permission createPermission(String permission) { if(InstancePermission.isInstancePermission(permission)) { return new InstancePermission(permission); } return new WildcardPermission(permission); } private  PermissionFactory(); static Permission createPermission(String permission);  }### Answer:
@Test public void testCreatesInstancePermission() { UUID instanceId = UUID.randomUUID(); Permission permission = PermissionFactory.createPermission("swit:x:" + instanceId.toString()); assertTrue(permission instanceof InstancePermission); }
@Test public void testCreatesWildcardPermission() { Permission permission = PermissionFactory.createPermission("swit:*:*"); assertTrue(permission instanceof WildcardPermission); }