Exercise for SOLID principles in JAVA