class SplitCommaReverseService implements SplitGeocoderStringService {

	public List<String> split(String location) {
		List<String> res = new ArrayList<String>();
		String remaining = location;
		for (int pos = remaining.indexOf(','); pos >= 0; pos = remaining.indexOf(',')) {
			String part = remaining.substring(0, pos).trim();
			if (part.length() > 0) {
				res.add(0, part);
			}
			remaining = remaining.substring(pos + 1);
		}
		remaining = remaining.trim();
		if (remaining.length() > 0) {
			res.add(0, remaining.trim());
		}
		return res;
	}

}