Coffee beans are very elastic. To see if your coffee beans are fresh bounce one on the floor. If it bounces the coffee is good.
If you are using ground coffee pour a teaspoon of it into an already filled cup of water. If it floats the coffee is good.