Updated the method signature to reflect actual behaviour and added tests for the same.