MRecordSources { public static MRecordSource of(MRecord... records) { return MRecordSources.of(MRecordSource.Kind.FINITE, Arrays.stream(records).iterator()); } private  MRecordSources(); static MRecordSource of(MRecord... records); static MRecordSource of(List<MRecord> list); static MRecordSource of(Iterator<MRecord> iterator); static MRecordSource of(MRecordSource.Kind kind, Iterator<MRecord> iterator);  }
@Test public void of_Array() { MRecordSource source = MRecordSources.of(new UntypedValues(), new UntypedValues()); assertTwoElements(source); }
@Test public void of_List() { MRecordSource source = MRecordSources.of(Arrays.asList(new UntypedValues(), new UntypedValues())); assertTwoElements(source); }
@Test public void of_Iterator() { Iterator<MRecord> iterator = Arrays.<MRecord>asList(new UntypedValues(), new UntypedValues()).iterator(); MRecordSource source = MRecordSources.of(iterator); assertTwoElements(source); assertEquals(MRecordSource.Kind.UNKNOWN, source.getKind()); }
@Test public void of_IteratorWithKind() { Iterator<MRecord> iterator = Arrays.<MRecord>asList(new UntypedValues(), new UntypedValues()).iterator(); MRecordSource source = MRecordSources.of(MRecordSource.Kind.FINITE, iterator); assertTwoElements(source); assertEquals(MRecordSource.Kind.FINITE, source.getKind()); }