test code for commonNode algorithm