### Question:
TypeSchemaMapper implements SchemaMapper { private static Collection<ColumnPair<?>> create(Iterable<Column<?>> columns1, Iterable<Column<?>> columns2) { return StreamUtils.seq(columns1).crossJoin(columns2) .map(t -> t.map(SchemaMapperHelper::toPair)) .flatMap(Optionals::stream) .collect(Collectors.toList()); }  @Override Collection<ColumnPair<?>> create(Schema schema); @Override Collection<ColumnPair<?>> create(Schema schema1, Schema schema2);  }### Answer:
@Test public void testSingleRelation() { SchemaMapper schemaMapper = new TypeSchemaMapper(); List<Column<?>> columns = Arrays.asList(A, B, C); Schema schema = Schema.of(columns); when(relation.getSchema()).thenReturn(schema); Collection<ColumnPair<?>> mapping = schemaMapper.create(relation); assertThat(mapping).hasSize(4); assertThat(mapping).contains(new ColumnPair<>(A, A)); assertThat(mapping).contains(new ColumnPair<>(B, B)); Assert.assertThat(mapping, either(hasItem(new ColumnPair<>(A, B))).or(hasItem(new ColumnPair<>(B, A)))); assertThat(mapping).contains(new ColumnPair<>(C, C)); }
@Test public void testTwoRelations() { SchemaMapper schemaMapper = new TypeSchemaMapper(); List<Column<?>> columns = Arrays.asList(A, B, C); Schema schema = Schema.of(columns); when(relation.getSchema()).thenReturn(schema); Collection<ColumnPair<?>> mapping = schemaMapper.create(relation, relation); assertThat(mapping).hasSize(5); assertThat(mapping).contains(new ColumnPair<>(A, A)); assertThat(mapping).contains(new ColumnPair<>(B, B)); assertThat(mapping).contains(new ColumnPair<>(A, B)); assertThat(mapping).contains(new ColumnPair<>(B, A)); assertThat(mapping).contains(new ColumnPair<>(C, C)); }