### Question:
TextUtil { public static <T> T getFirstNonNull(T... values) { if (values == null || values.length < 1) { return null; } List<T> list = Arrays.asList(values); for (T item : list) { if (item != null) { return item; } } return null; } private  TextUtil(); static T getFirstNonNull(T... values); static String getFirstNonEmpty(String... values); static T getFirstProperty(Resource resource, Class<T> klass, String... keys); static T getFirstProperty(ValueMap valueMap, Class<T> klass, String... keys); static boolean isRichText(String str);  }### Answer:
@Test public void testGetFirstNonNull_String() { String first = null; String second = null; String third = "third"; String fourth = null; String expResult = "third"; String result = TextUtil.getFirstNonNull(first, second, third, fourth); assertEquals(expResult, result); }
@Test public void testGetFirstNonNull_int() { int first = 1; int second = 2; int third = 3; int fourth = 4; int expResult = 1; int result = TextUtil.getFirstNonNull(first, second, third, fourth); assertEquals(expResult, result); }