Java library lld issue: fix twice available count issue

Author: syedmaqsoodblrCreated Oct 28, 2025Updated Oct 28, 2025

https://github.com/ashishps1/awesome-low-level-design/blob/43017e5e22eeedcf74234e6b80fcbec3a7554ab5/solutions/java/src/librarymanagementsystem/LibraryManagementSystem.java#L32

Issue: creating two BookCopy instances, each one adds itself to the LibraryItem copy list in its constructor.

Solution: copies.put(copyId, copy); instead of copies.put(copyId, new BookCopy(copyId, item));

Source: ashishps1/awesome-low-level-design