### Question:
IpPermissions extends IpPermission { public static ToSourceSelection permitAnyProtocol() { return new ToSourceSelection(IpProtocol.ALL, 1, 65535); } protected  IpPermissions(IpProtocol ipProtocol, int fromPort, int toPort,
         Multimap<String, String> tenantIdGroupPairs, Iterable<String> groupIds, Iterable<String> cidrBlocks,
         Iterable<String> exclusionCidrBlocks); static ICMPTypeSelection permitICMP(); static ToSourceSelection permitAnyProtocol(); static PortSelection permit(IpProtocol protocol);  }### Answer:
@Test(expectedExceptions = IllegalArgumentException.class) public void testAllProtocolInvalidCidr() { IpPermissions authorization = IpPermissions.permitAnyProtocol(); assertEquals(authorization, IpPermission.builder().ipProtocol(IpProtocol.ALL).fromPort(1).toPort(65535) .cidrBlock("a.0.0.0/0").build()); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testAllProtocolInvalidExclusionCidr() { IpPermissions authorization = IpPermissions.permitAnyProtocol(); assertEquals(authorization, IpPermission.builder().ipProtocol(IpProtocol.ALL).fromPort(1).toPort(65535) .exclusionCidrBlock("a.0.0.0/0").build()); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testAllProtocolInvalidCidrMultiple() { IpPermissions authorization = IpPermissions.permitAnyProtocol(); assertEquals(authorization, IpPermission.builder().ipProtocol(IpProtocol.ALL).fromPort(1).toPort(65535) .cidrBlocks(ImmutableSet.of("a.0.0.0/0", "0.0.0.0/0")).build()); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testAllProtocolInvalidExclusionCidrMultiple() { IpPermissions authorization = IpPermissions.permitAnyProtocol(); assertEquals(authorization, IpPermission.builder().ipProtocol(IpProtocol.ALL).fromPort(1).toPort(65535) .exclusionCidrBlocks(ImmutableSet.of("a.0.0.0/0", "0.0.0.0/0")).build()); }