Merge "Fix null ptr in test cases by supplying a test adapter." into jb-dev