CDAHelper { public static ST buildTitle(String title) { ST displayTitle = DatatypesFactory.eINSTANCE.createST(); if(title!=null) { displayTitle.addText(title); } return displayTitle; }  static SimpleDateFormat getDateFormat(); static IVL_TS buildEffectiveTimeinIVL(Date d , Date d1); static IVL_TS buildEffectiveTimeinIVL(Date d); static II buildTemplateID(String root , String extension ,String assigningAuthorityName); static ST buildTitle(String title); static II buildID(String root , String extension); static CE buildCodeCE(String code , String codeSystem, String displayString, String codeSystemName); static CD buildCodeCD(String code , String codeSystem, String displayString, String codeSystemName); static TS buildEffectiveTime(Date d); static ED buildEDText(String value); static String getDatatypesValue(Integer datatypeId,Obs obs); static Obs getLatestObs(List<Obs> observationList); static CS getStatusCode(String statusCode); static IVL_TS buildDateTime(Date date); static String getCodeSystemByName(String codeSystemName); static String removeDirtyValue(String input); static String getUnitsaccordingto_Tf_PCC(String unit); static String getConceptIdasString(int conceptId);  }
@Test public void shouldContainEmptyStringIfTitleIsNull() { ST title=CDAHelper.buildTitle(null); String value=title.getText(); Assert.assertEquals(value,""); }
@Test public void shouldPassIfTitleIsHasValue() { ST title=CDAHelper.buildTitle("Testing"); String value=title.getText(); Assert.assertEquals(value,"Testing"); }