Apple Inc. is leasing a small fleet of cars from Hertz Global Holdings Inc. to test self-driving technology, an agreement that echoes a larger deal between competitors Alphabet Inc. and Avis Budget Group Inc. Hertz shares soared the most in almost two years.