Make collector testable and add native test