add unittest for core_collapse
related to #41