remove junit dependency for non-test case
improve testing compatibility
code format