Rewrite RebaseTest in scala