@Test
public void testValidateAndTrimSecurityFunctionKey()
{

    // Create a security function key.
    SecurityFunctionKey securityFunctionKey = new SecurityFunctionKey(SECURITY_FUNCTION);
    // Mock the external calls.
    when(alternateKeyHelper.validateStringParameter("security function name", SECURITY_FUNCTION)).thenReturn(SECURITY_FUNCTION_2);
    // Call the method under test.
    securityFunctionHelper.validateAndTrimSecurityFunctionKey(securityFunctionKey);
    // Validate the results.
    assertEquals(new SecurityFunctionKey(SECURITY_FUNCTION_2), securityFunctionKey);
    // Verify the external calls.
    verify(alternateKeyHelper).validateStringParameter("security function name", SECURITY_FUNCTION);
    verifyNoMoreInteractions(alternateKeyHelper);
}