@Test
public void test_digestIp() {

	// comlete wildcards get reduced to empty string.
	RangerIpMatcher matcher = new RangerIpMatcher();
	Assert.assertEquals("", matcher.digestPolicyIp("*"));
	Assert.assertEquals("", matcher.digestPolicyIp("*.*"));
	Assert.assertEquals("", matcher.digestPolicyIp("*.*.*"));
	Assert.assertEquals("", matcher.digestPolicyIp("*.*.*.*"));
	Assert.assertEquals("", matcher.digestPolicyIp("*:*:*:*"));
	Assert.assertEquals("", matcher.digestPolicyIp("*:*:*:*:*:*"));
	// wildcard parts get dropped; retails trailing ./: to avoid doing partial number match
	Assert.assertEquals("10.", matcher.digestPolicyIp("10.*"));
	Assert.assertEquals("10.", matcher.digestPolicyIp("10.*.*"));
	Assert.assertEquals("10.", matcher.digestPolicyIp("10.*.*.*"));
	Assert.assertEquals("10.20.", matcher.digestPolicyIp("10.20.*"));
	Assert.assertEquals("10.20.", matcher.digestPolicyIp("10.20.*.*"));
	Assert.assertEquals("10.20.30.", matcher.digestPolicyIp("10.20.30.*"));
	
	// ipv6 digested values are also lower cased to ensure sensible comparison later
	Assert.assertEquals("a0:", matcher.digestPolicyIp("A0:*"));
	Assert.assertEquals("a0:", matcher.digestPolicyIp("a0:*:*"));
	Assert.assertEquals("a0:", matcher.digestPolicyIp("A0:*:*:*"));
	Assert.assertEquals("a0:b0:c0:", matcher.digestPolicyIp("A0:B0:C0:*"));
}