### Question:
StringUtil { public static final boolean checkValidEmail(String emailAddress) { boolean isValid = true; if ( StringUtil.checkNotEmpty(emailAddress) ) { int atIndex = emailAddress.indexOf('@'); if ( atIndex > 0 ) { if ( emailAddress.indexOf('.', atIndex) > 0 ) { isValid = true; } else { isValid = false; } } else { isValid = false; } } else { isValid = false; } return isValid; }  static final String substring(String line, String start, String end); static final String substringR(String line, String start, String end); static final String concat(Object ... value ); static final int toInt(String str, int defaultValue); static final float toFloat(String str, float defaultValue); static final boolean checkNotEmpty(String str); static final void padStringRight(StringBuilder buf, String str, int length); static final String bytesToHexString(byte[] bytes); static final byte[] hexStringToBytes(String hexString); static final String[] splitMachineId(String machineId); static final Locale parseLocale(String languageTag, Locale defaultLocale); static final boolean checkValidEmail(String emailAddress); static String encryptSHA1(String data); static String encryptMD5(String data);  }### Answer:
@Test public void testCheckValidEmail() { String email = "wangqi@xinqihd.com"; boolean valid = StringUtil.checkValidEmail(email); assertEquals(true, valid); }
@Test public void testCheckValidEmailDomain() { String email = "wangqi@xinqihd.com.cn"; boolean valid = StringUtil.checkValidEmail(email); assertEquals(true, valid); }
@Test public void testCheckValidEmailEmpty() { String email = ""; boolean valid = StringUtil.checkValidEmail(email); assertEquals(false, valid); }
@Test public void testCheckValidEmailNull() { String email = null; boolean valid = StringUtil.checkValidEmail(email); assertEquals(false, valid); }
@Test public void testCheckValidEmail1() { String email = "wangqi@xinqihd"; boolean valid = StringUtil.checkValidEmail(email); assertEquals(false, valid); }
@Test public void testCheckValidEmail2() { String email = "@xinqihd.com"; boolean valid = StringUtil.checkValidEmail(email); assertEquals(false, valid); }
@Test public void testCheckValidEmail3() { String email = "wangqi@"; boolean valid = StringUtil.checkValidEmail(email); assertEquals(false, valid); }