Can you write unit test for this method?