add Collection and serializable iterator input for scala