| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package com.google.common.collect.testing; |
| 18 |
|
| 19 |
import com.google.common.collect.testing.features.CollectionFeature; |
| 20 |
import com.google.common.collect.testing.features.CollectionSize; |
| 21 |
import java.util.Collection; |
| 22 |
import junit.framework.Test; |
| 23 |
import junit.framework.TestCase; |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
public class MinimalCollectionTest extends TestCase { |
| 31 |
public static Test suite() { |
| 32 |
return CollectionTestSuiteBuilder.using( |
| 33 |
new TestStringCollectionGenerator() { |
| 34 |
@Override |
| 35 |
public Collection<String> create(String[] elements) { |
| 36 |
|
| 37 |
for (Object element : elements) { |
| 38 |
if (element == null) { |
| 39 |
throw new NullPointerException(); |
| 40 |
} |
| 41 |
} |
| 42 |
return MinimalCollection.of(elements); |
| 43 |
} |
| 44 |
}) |
| 45 |
.named("MinimalCollection") |
| 46 |
.withFeatures(CollectionFeature.NONE, CollectionSize.ANY) |
| 47 |
.createTestSuite(); |
| 48 |
} |
| 49 |
} |