@Test
public void testRemovePermission() {

	ClientPermissions clientPermission = new ClientPermissions();
	final String secret1 = "test1";
	final String secret2 = "test2";
	final String secret3 = "test3";
	clientPermission.addPermission(secret1, Permissions.GENERATE);
	Assert.assertEquals(1, clientPermission.getSecrets().size());
	// Ensure only one permission impacted
	Assert.assertTrue(clientPermission.hasPermission(secret1, Permissions.GENERATE));
	Assert.assertFalse(clientPermission.hasPermission(secret2, Permissions.GENERATE));
	// Ensure no other permissions impacted
	Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.DELETE));
	Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.DISABLE));
	Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.ENABLE));
	Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.EXPONENTIATE));
	Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.INFO));
	Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.READ));
	// Test remove never-referenced secret
	clientPermission.removePermission(secret3, Permissions.GENERATE);
	Assert.assertFalse(clientPermission.hasPermission(secret3, Permissions.GENERATE));
	Assert.assertEquals(1, clientPermission.getSecrets().size());
	// Test remove non-existent secret
	clientPermission.removePermission(secret2, Permissions.GENERATE);
	Assert.assertFalse(clientPermission.hasPermission(secret2, Permissions.GENERATE));
	Assert.assertEquals(1, clientPermission.getSecrets().size());
	// Test remove non-existent permission
	clientPermission.removePermission(secret1, Permissions.INFO);
	Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.INFO));
	Assert.assertEquals(1, clientPermission.getSecrets().size());
	// Test remove existing permission
	Assert.assertTrue(clientPermission.hasPermission(secret1, Permissions.GENERATE));
	clientPermission.removePermission(secret1, Permissions.GENERATE);
	Assert.assertEquals(0, clientPermission.getSecrets().size());
	Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.GENERATE));
	// Test double remove
	Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.GENERATE));
	clientPermission.removePermission(secret1, Permissions.GENERATE);
	Assert.assertEquals(0, clientPermission.getSecrets().size());
	Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.GENERATE));
}