Why avoid mocks

Does it work if String.trim is called outside that block?