Java - clarify extends