Pdi 9538 - http://jira.pentaho.com/browse/PDI-9538

What was done:
1) Created the fix
2) refactored the code a bit to have utilitary method
3) created unit test