Move comparison before "j.clear()" function call, such that the intended return value "true" is actually correct.