Fixed DIP example (Java) to only violate one principle