public static String join(Collection collection, String separator) {
        if (collection == null) {
            return null;
        }
        
        StringBuilder stringBuilder = new StringBuilder();
        Object[] objects = collection.toArray();
        
        for (int i = 0; i < collection.size(); i++) {
            if (objects[i] != null) {
                stringBuilder.append(objects[i]);
                if (i != collection.size() - 1 && separator != null) {
                    stringBuilder.append(separator);
                }
            }
        }
        
        return stringBuilder.toString();
    }
@Test
    void testJoin() {
        ArrayList<Object> objects = new ArrayList<>();
        objects.add(null);
        assertNull(StringUtils.join(null, "a"));
        assertEquals(StringUtils.EMPTY, StringUtils.join(Arrays.asList(), "a"));
        assertEquals(StringUtils.EMPTY, StringUtils.join(objects, "a"));
        assertEquals("a;b;c", StringUtils.join(Arrays.asList("a", "b", "c"), ";"));
        assertEquals("abc", StringUtils.join(Arrays.asList("a", "b", "c"), null));
    }