Jon's answer is the right one, but occasionally you can't get around that warning (like when you're working with a legacy API). In those cases you can suppress the warning like so:
@SuppressWarnings("unchecked")
List list = (List) someApiThatReturnsNonGenericList();