Tests for toList and fromList