@Test public void splitIpTest() { String str1 = "127.0.0.1,127.0.0.2"; String str2 = "127.0.0.1,"; String str3 = ",127.0.0.1"; String str4 = "127.0.0.1"; String str5 = ""; assertThat(StringUtilsEx.splitByComma(str1).equals(Lists.newArrayList("127.0.0.1","127.0.0.2"))); assertThat(StringUtilsEx.splitByComma(str2).equals(Lists.newArrayList("127.0.0.1"))); assertThat(StringUtilsEx.splitByComma(str3).equals(Lists.newArrayList("127.0.0.1"))); assertThat(StringUtilsEx.splitByComma(str4).equals(Lists.newArrayList("127.0.0.1"))); assertThat(StringUtilsEx.splitByComma(str5).equals(Lists.newArrayList())); assertThat(StringUtilsEx.splitByComma(str5).size()==0); }
public static List<String> splitByComma(String ipsString){ String[] ips= ipsString.split(","); return Lists.newArrayList(ips); }
StringUtilsEx { public static List<String> splitByComma(String ipsString){ String[] ips= ipsString.split(","); return Lists.newArrayList(ips); } }
StringUtilsEx { public static List<String> splitByComma(String ipsString){ String[] ips= ipsString.split(","); return Lists.newArrayList(ips); }  }
StringUtilsEx { public static List<String> splitByComma(String ipsString){ String[] ips= ipsString.split(","); return Lists.newArrayList(ips); }  static boolean isValidIp(String ip); static List<String> findSystemVariableString(String str); static List<String> splitByComma(String ipsString); }
StringUtilsEx { public static List<String> splitByComma(String ipsString){ String[] ips= ipsString.split(","); return Lists.newArrayList(ips); }  static boolean isValidIp(String ip); static List<String> findSystemVariableString(String str); static List<String> splitByComma(String ipsString);  }