add func and unit test

add sample function and unit test for it.