JUnit tests for join and merge methods