Simple use cases illustrating how weak references works in Java