@Override public Iterator<String> iterator() { return Iterators.empty(); }
@Override public Iterator<T> iterator() { return readOnly(iterable.iterator(), conversion); } };
/** * Create an iterator over an infinite number monotonically increasing numbers starting at the given number, useful when * performing an operation an unknown number of times. * * @param startingAt the first number to include in the resulting stream * @return the sequence; never null */ public static Iterable<Integer> infiniteIntegers(int startingAt) { return Iterators.around(new Iterator<Integer>() { private int counter = startingAt; @Override public boolean hasNext() { return true; } @Override public Integer next() { return Integer.valueOf(counter++); } }); }
@Override public Iterator<String> iterator() { return Iterators.with(segments); }
@Override public Iterator<String> iterator() { return Iterators.join(parent, segment); }
try { final PreviewIterator<Document> expectedRecords = Iterators.preview(testData.read()); final Consumer<Document> recorder = testData::write;
@Override public Iterator<String> iterator() { return Iterators.with(segment.get()); }
public static <T> Iterator<T> join(Iterable<T> first, Iterable<T> second) { return join(first.iterator(), second.iterator()); }
try { final PreviewIterator<Document> expectedRecords = Iterators.preview(testData.read()); final Consumer<Document> recorder = testData::write;
@Override public Iterator<T> iterator() { return readOnly(iterable.iterator()); } };
public TestSpecification(String name, Configuration config, Configuration env, Function<TestSpecification, TestData> dataSupplier, AvailableVariables variables) { this.name = name != null ? name : ""; this.variables = (variables != null ? variables : AvailableVariables.empty()).and(builtInVariables()); this.config = config != null ? config.withReplacedVariables(this.variables::variableForName) : Configuration.empty(); this.env = env != null ? env.withReplacedVariables(this.variables::variableForName) : Configuration.empty(); this.dataSupplier = dataSupplier != null ? dataSupplier : (spec) -> () -> Iterators.empty(); }
@Override public Iterator<Field> iterator() { return Iterators.around(fields.entrySet(), CONVERT_ENTRY_TO_FIELD); }
@Override public Iterator<String> iterator() { return Iterators.with(segments); }
@Override public Iterator<String> iterator() { return Iterators.join(parent, segment); }
public static <V, T> Iterator<T> readOnly(final Iterable<V> iterable, Function<V, T> conversion) { return readOnly(iterable.iterator(), conversion); }
@Override public Iterator<String> iterator() { return Iterators.empty(); }