We are going to write this code with Java and Spring Framework. The aim is to demonstrate the logic code is not contaminated by the Spring Framework, whereas all the infrastructure wirings utilize Spring Framework capabilities.
Please check these articles:
https://medium.com/@alexdorand/port-and-adaptor-pattern-part-1-af267e4725d8
https://medium.com/@alexdorand/a-practical-guide-to-port-and-adapter-pattern-part-2-edb38e808a72