TypeConversion { public static List<String> convertTagStringToList(String tags) { if (tags == null || tags.isEmpty()) { return Collections.emptyList(); } return Arrays.asList(tags.split(",")); }  static com.google.protobuf.Timestamp convertTimestamp(Date ts); static List<String> convertTagStringToList(String tags); static Map<String, String> convertJsonStringToMap(String jsonString); static Map<String, Enum> convertJsonStringToEnumMap(String jsonString); static String convertMapToJsonString(Map<String, String> map); static String convertEnumMapToJsonString(Map<String, Enum> map);  }
@Test public void convertTagStringToListShouldConvertTagStringToList() { String input = "value1,value2"; List<String> expected = Arrays.asList("value1", "value2"); assertThat(TypeConversion.convertTagStringToList(input), equalTo(expected)); }
@Test public void convertTagStringToListShouldReturnEmptyListForEmptyString() { String input = ""; List<String> expected = Collections.emptyList(); assertThat(TypeConversion.convertTagStringToList(input), equalTo(expected)); }