turned Iterable to ArrayList, fixed potential null pointer in reservoir sampling