import java.util.*; /* This class provides a service of printing Printable objects to the console * It prints the Printable object's title first with an underline and then * prints the Printable object's contents * */ public class PrintingService{ private static String UNDERLINE = "========================================================================"; public void print(Printable aPrintable){ String title = aPrintable.getTitle(); ArrayList contents = aPrintable.getContents(); System.out.println(""); System.out.println(title); System.out.println(UNDERLINE.substring(0, title.length())); for(String s : contents){ System.out.println(s); } } } //end class PrintingService