Apparatus and method for inspecting the end surface of a pellet