manually build ArrayList from primitive array