@Test public void joinString(){ String [] array = new String[] {"associate", "sales", "manager"}; String expected = "associate sales manager"; String actual = Utility.joinString(array, " "); Assert.assertTrue(expected.compareTo(actual) == 0); }
public static String joinString(String [] list, String conjunction) { StringBuilder sb = new StringBuilder(); boolean first = true; for (String item : list) { if (first) first = false; else sb.append(conjunction); sb.append(item); } return sb.toString(); }
Utility { public static String joinString(String [] list, String conjunction) { StringBuilder sb = new StringBuilder(); boolean first = true; for (String item : list) { if (first) first = false; else sb.append(conjunction); sb.append(item); } return sb.toString(); } }
Utility { public static String joinString(String [] list, String conjunction) { StringBuilder sb = new StringBuilder(); boolean first = true; for (String item : list) { if (first) first = false; else sb.append(conjunction); sb.append(item); } return sb.toString(); }  }
Utility { public static String joinString(String [] list, String conjunction) { StringBuilder sb = new StringBuilder(); boolean first = true; for (String item : list) { if (first) first = false; else sb.append(conjunction); sb.append(item); } return sb.toString(); }  static int getArgMax(double[] array); static int booleansToInt(boolean [] booleans); static void intToBooleans(int intValue, boolean [] booleans); static String joinString(String [] list, String conjunction); }
Utility { public static String joinString(String [] list, String conjunction) { StringBuilder sb = new StringBuilder(); boolean first = true; for (String item : list) { if (first) first = false; else sb.append(conjunction); sb.append(item); } return sb.toString(); }  static int getArgMax(double[] array); static int booleansToInt(boolean [] booleans); static void intToBooleans(int intValue, boolean [] booleans); static String joinString(String [] list, String conjunction);  }