@Test
public void testValidateAndTrimSecurityRoleKey()
{

    // Create a security role key.
    SecurityRoleKey securityRoleKey = new SecurityRoleKey(SECURITY_ROLE);
    // Mock the external calls.
    when(alternateKeyHelper.validateStringParameter("security role name", SECURITY_ROLE)).thenReturn(SECURITY_ROLE_2);
    // Call the method under test.
    securityRoleHelper.validateAndTrimSecurityRoleKey(securityRoleKey);
    // Validate the results.
    assertEquals(new SecurityRoleKey(SECURITY_ROLE_2), securityRoleKey);
    // Verify the external calls.
    verify(alternateKeyHelper).validateStringParameter("security role name", SECURITY_ROLE);
    verifyNoMoreInteractions(alternateKeyHelper);
}