add unit test for static factory