"Like" and "such as" seem to fit the exact same sentences:
I want a cookie like that
I want a cookie such as that
There are plenty of variations where they differ:
I like cookies
I, like, eat cookies
I use cookies as such: Eat them; bake them; store them.
But the usage I am interested in is when they compare one thing to another. When is it best to use one or the other? Are there different connotations? Other examples:
A friend like you is a treasure / A friend such as you is a treasure
I hate tests like these / I hate tests such as these
No one cares like you / No one cares such as you
The last "such as" seems iffy to me.