Write ArrayList's clear() and insert() methods.