This example suggests the idea of amount/measure and Content-Container coexists with Measure, but it is pragmatically inferred from it -since liquids, and especially coffee are usually served in cups.
while the overlap in (5) always holds, the overlaps in (6) and (7) are most of the time resolved by the linguistic context (syntax, semantics) and the context of use (pragmatics).