An association implies dependency.
At the code level a reference to another class or instance usually is at least an association.
The only way I can imagine a dependency in
Java code that isn't an association is an unused object member or an unused method parameter. Once you start using methods on the object you are defining the semantics of the relationship
at which point the relationship is at least an association.
Your example has a dependency (which isn't an association) because you are not using bar inside of Foo.do. The moment you call a method on bar inside of do() you are defining the semantics of the relationship between Foo and Bar - now there is an association between Foo and Bar.
Dependency is also used more as an 'aspect' rather than a full-blown concept. There are many types of dependencies that can adorn an inter-classifier relationship: access, binding, call, creation, derivation, instantiation, permission, realization, refinement, send, substitution, trace dependency, usage.