Solid Principles in JAVA with Example