ABOUT THIS PROJECT: This repository contains the complete implementation of an Object-Oriented Programming (OOP) system. It simulates a complex logistics and parcel delivery network for a fictional company called AmazingCo. It was made as the second practice of the subject OOP, first quarter of the second year.
The codebase enforces strict SOLID principles, extensive use of Polymorphism, and maintains a flawless 100% Test Coverage ensuring zero dead code and high fault tolerance.
The system routes packages to specific destinations based on geospatial coordinates (GPS), package type (Certified, Paid, Cash-on-Delivery), and point capacity.
PickingPointsSystem: The central orchestrator managing the entire network. Responsible for geospatial filtering and package eligibility routing.PickingPoint(Abstract Base): Defines the contract for all delivery locations.PostOffice: The only entity authorized to handle highly secureCertifiedpackages.GroupablePoint(Abstract): Points that can be clustered together.Kiosk: Manned points that accept Cash-on-Delivery packages and manage cash collections.PackageLocker: Automated lockers with strict physical capacities.
PickingPointHub: A composite entity grouping multipleGroupablePointstogether dynamically, sharing a single GPS coordinate.
Package: The core data entity carrying tracking codes, payment status, expiry dates, and certified ID authorizations. Validates checksums internally.GPSCoordinate: Utility for geospatial calculations, utilizing the Vincenty formulae for ellipsoids to calculate precise Earth distances.
- Geospatial Filtering: Calculates real-world distances between points to return eligible picking points within a specific radius.
- Business Logic Routing: Automatically filters delivery eligibility based on package criteria (e.g., Unpaid packages are strictly routed to points supporting Cash-on-Delivery).
- Fault Tolerance: Exhaustive input validation throwing precise
IllegalArgumentExceptions for null states, duplicate identifiers, or logical impossibilities (e.g., overbooking a locker or retrieving an already picked-up package). - Test-Driven Development (TDD): Built using a strict testing methodology.
This project features a massive, meticulously engineered test suite that covers 100% of the lines, branches, and conditions across the critical path components.
The test suite (PickingPointsSystemTest, KioskTest, PickingPointHubTest) validates:
- Every constructor,
if/elsebranch, and logical short-circuit. - Edge cases, Null Pointer defenses, and Exception handling.
- Overridden
equals(),hashCode(), andtoString()methods across the inheritance tree. - Mocking of geographic anomalies and reflection hacks to verify unreachable defensive code.
To run the system and verify the coverage locally:
- Clone this repository:
git clone https://github.com/YourUsername/POO-Logistics-Network.git - Import the project into your preferred Java IDE (Eclipse, IntelliJ IDEA, or VS Code).
- Ensure JUnit 4 is added to your Build Path.
- Run the files inside the
test/directory using your IDE's Test Runner. - Run with a Coverage tool to view the 100% branch execution.
-Iván Moro Cienfuegos and Eric Soto San José

