Life without generics and list comprehensions

I make utilities for Apex because I miss list comprehensions, and I wind up missing generics instead..

 
    public static List filter(List Objs, String field, String comparator, Object value){
    	 Set VALID_COMPARITORS = new Set{'< ', '>', '< =', '>=', '=='};
    	if (!VALID_COMPARITORS.contains(comparator)){
    		throw new InvalidComparatorException();
    	}
        
    	List ret = new List();

    	Boolean gt = comparator == '>' || comparator == '>=';
    	Boolean lt = comparator == '< ' || comparator == '<=';
    	Boolean eq = comparator == '==' || comparator == '<='  || comparator == '>=';
    	for(SObject o: Objs){
    		Boolean valid_object;

    		valid_object = value instanceof Integer && (
	    			(gt && (Integer) o.get(field) > (Integer) value) || (lt && (Integer) o.get(field) < (Integer) value) || (eq && (Integer) o.get(field) == (Integer) value)
    			) || value instanceof Decimal && (
	    			(gt && (Decimal) o.get(field) >  (Decimal) value) || (lt && (Decimal) o.get(field) < (Decimal) value) || (eq && (Decimal) o.get(field) == (Decimal) value)
    			) || value instanceof Date && (
	    			(gt && (Date) o.get(field) > (Date) value) || (lt && (Date) o.get(field) < (Date) value) || (eq && (Date) o.get(field) == (Date) value)
    			) || value instanceof Datetime && (
	    			(gt && (Datetime) o.get(field) > (Datetime) value) || (lt && (Datetime) o.get(field) < (Datetime) value) || (eq && (Datetime) o.get(field) == (Datetime) value)
    			) || value instanceof Time && (
	    			(gt && (Time) o.get(field) > (Time) value) || (lt && (Time) o.get(field) < (Time) value) || (eq && (Time) o.get(field) == (Time) value)
    			) || value instanceof Long && (
	    			(gt && (Long) o.get(field) > (Long) value) || (lt && (Long) o.get(field) < (Long) value) || (eq && (Long) o.get(field) == (Long) value)
    			);
			if (valid_object) ret.add(o);
    	}
    	return ret;
    }