EMMA Coverage Report (generated Fri Aug 23 16:39:17 PDT 2013)
[all classes][org.chromium.base]

COVERAGE SUMMARY FOR SOURCE FILE [CollectionUtil.java]

nameclass, %method, %block, %line, %
CollectionUtil.java100% (1/1)75%  (3/4)94%  (44/47)91%  (10/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CollectionUtil100% (1/1)75%  (3/4)94%  (44/47)91%  (10/11)
CollectionUtil (): void 0%   (0/1)0%   (0/3)0%   (0/1)
newArrayList (Iterable): ArrayList 100% (1/1)100% (20/20)100% (4/4)
newArrayList (Object []): ArrayList 100% (1/1)100% (12/12)100% (3/3)
newHashSet (Object []): HashSet 100% (1/1)100% (12/12)100% (3/3)

1// Copyright 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4 
5package org.chromium.base;
6 
7import java.util.ArrayList;
8import java.util.Collections;
9import java.util.HashSet;
10 
11/**
12 * Functions used for easier initialization of Java collections. Inspired by
13 * functionality in com.google.common.collect in Guava but cherry-picked to
14 * bare-minimum functionality to avoid bloat. (http://crbug.com/272790 provides
15 * further details)
16 */
17public final class CollectionUtil {
18    private CollectionUtil() {}
19 
20    public static <E> HashSet<E> newHashSet(E... elements) {
21        HashSet<E> set = new HashSet<E>(elements.length);
22        Collections.addAll(set, elements);
23        return set;
24    }
25 
26    public static <E> ArrayList<E> newArrayList(E... elements) {
27        ArrayList<E> list = new ArrayList<E>(elements.length);
28        Collections.addAll(list, elements);
29        return list;
30    }
31 
32    public static <E> ArrayList<E> newArrayList(Iterable<E> iterable) {
33        ArrayList<E> list = new ArrayList<E>();
34        for (E element : iterable)
35            list.add(element);
36        return list;
37    }
38}

[all classes][org.chromium.base]
EMMA 2.0.5312 (C) Vladimir Roubtsov