@Override
    public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) {
        return format.format(toArgs((Attributes) obj), result, pos);
    }
@Test
    public void testFormatMD5() {
        Attributes attrs = new Attributes();
        attrs.setString(Tag.StudyDate, VR.DA, "20111012");
        attrs.setString(Tag.StudyTime, VR.TM, "0930");
        attrs.setString(Tag.StudyInstanceUID, VR.UI, "1.2.3");
        attrs.setString(Tag.SeriesInstanceUID, VR.UI, "1.2.3.4");
        attrs.setString(Tag.SOPInstanceUID, VR.UI, "1.2.3.4.5");
        assertEquals("2011/10/12/09/02C82A3A/71668980/08vpsu2l2shpb0kc3orpgfnhv0.dcm",
                new AttributesFormat(TEST_PATTERN_MD5).format(attrs));
    }