Added a mathod and a test case