public static <T> List<T> limit(Iterable<T> source, int limit) {
        var result = new ArrayList<T>();
        var count = 0;
        for (var s : source) {
            result.add(s);
            count++;
            if (count == limit)
                return result;
        }
        return result;
    }
@Test
    public void testLimit() throws Exception {
        var source = Lists.newArrayList(1, 2, 3, 4, 5);
        var result = CollectionUtil.limit(source, 3);
        assertThat(result).isEqualTo(Lists.newArrayList(1, 2, 3));
    }