### Question:
HarUtils { public static <T> String defaultIfNull(T obj, String str) { return isNull(obj) ? str : obj.toString(); }  static String toPrettyJsonString(Object value); static String toJsonString(Object value); static Map<String, Object> fromJsonString(String json); static boolean isNotNull(T object); static boolean isNull(T object); static String defaultIfNull(T obj, String str); static List<T> defaultIfNull(List<T> obj); static void validateJSON(String jsonInString); List<HarQueryString> processQueryStrings(List<HarQueryString> harQueryStrings); List<HarCookie> processCookies(HarRequest harRequest); List<HarParam> processParams(HarPostData postData); List<HarHeader> processHeaders(HarRequest harRequest); String defaultMimeType(final String mimeType);  }### Answer:
@Test void testDefaultIfNull() { Object nullInteger = null; String result = HarUtils.defaultIfNull(nullInteger, "10"); assertEquals("10", result); result = HarUtils.defaultIfNull(20, "10"); assertEquals("20", result); List<String> strings = null; List<String> rList = HarUtils.defaultIfNull(strings); assertNotNull(rList); assertEquals(rList.size(), 0); List<String> iList = new ArrayList<>(); iList.add("foo"); rList = HarUtils.defaultIfNull(iList); assertNotNull(rList); assertEquals(iList, rList); }