PURPOSE: This phase I/II trial is studying the side effects and best dose of lenalidomide when given together with rituximab and combination chemotherapy and to see how well they work in treating patients with newly diagnosed stage II, stage III, or stage IV diffuse large cell or follicular B-cell lymphoma.