CitizenId implements Identity { @Override public String prettyPrint() { return printer.print(id); } CitizenId(String id); static boolean isValid(String id); @Override boolean validate(); @Override boolean isValidFormat(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); @Override String prettyPrint(); @Override String getId();  }
@Test public void prettyPrint() { CitizenId cid; cid = new CitizenId("1610255822220"); assertEquals("pretty Print not as except ", "1-6102-55822-22-0", cid.prettyPrint()); cid = new CitizenId("1610255811112"); assertEquals("pretty Print not as except ", "1-6102-55811-11-2", cid.prettyPrint()); cid = new CitizenId("161025"); assertEquals("pretty Print not as except ", "1-6102-5", cid.prettyPrint()); }