Fix NPE in test infrastructure Reviewed-by: ksrini, jfranck, alanb, rfield
Better checking in getEnclosing(Method|Constructor|Class) Reviewed-by: darcy, ahgross, mchung