modified cap_First_Common_Ancestor.java with new method