Utils { public static String join(String delimiter, Object... objects) { return join(delimiter, Arrays.asList(objects)); }  static String calculateITableName(String databaseName, String tableName, String indexName); static String calculateITableName(Index index); static String calculateITableName(IndexIdentifier indexId); @Deprecated static void initDatabase(String cqlPath, Session session); static void initDatabase(boolean dropDb, String replicationString, Session session); static void initDatabaseSingleReplication(boolean dropDb, Session session); static void setField(String value, IndexField fieldData, BoundStatement bs, int index); static boolean setField(DBObject jsonObject, IndexField fieldData, BoundStatement bs, int index); static String join(String delimiter, Object... objects); static String join(String delimiter, Collection<? extends Object> objects); static boolean equalLists(List<String> one, List<String> two); static void writeFile(String toWrite, String fileName); static String readFile(String fileName); static List<Long> traverse1RowFile(String fileName); static final String EMPTY_STRING; }
@Test public void testJoin_String_ObjectArr() { logger.debug("join"); String expResult = "one"; String result = Utils.join(", ", "one"); assertEquals(expResult, result); expResult = "one, two"; result = Utils.join(", ", "one", "two"); assertEquals(expResult, result); }
@Test public void testJoin_String_Collection() { logger.debug("join"); List<String> list = new ArrayList<>(); String expResult = ""; String result = Utils.join(", ", list); assertEquals(expResult, result); list.add("one"); expResult = "one"; result = Utils.join(", ", list); assertEquals(expResult, result); list.add("two"); expResult = "one, two"; result = Utils.join(", ", list); assertEquals(expResult, result); }