write tests for initialize method