@Test
public void testChildInnerJoin() {

	Function<FromStep, JoinStep> childJoinFunction =
		fromStep -> fromStep.from(
			ReferenceExampleTable.INSTANCE
		).innerJoinON(
			MainExampleTable.INSTANCE,
			MainExampleTable.INSTANCE.mainExampleId.eq(
				ReferenceExampleTable.INSTANCE.mainExampleId)
		);
	TableReferenceDefinition<MainExampleTable> tableReferenceDefinition =
		new TestTableReferenceDefinition<MainExampleTable>(
			MainExampleTable.INSTANCE) {
			@Override
			public void defineChildTableReferences(
				ChildTableReferenceInfoBuilder<MainExampleTable>
					childTableReferenceInfoBuilder) {
				childTableReferenceInfoBuilder.referenceInnerJoin(
					childJoinFunction);
			}
			@Override
			public void defineParentTableReferences(
				ParentTableReferenceInfoBuilder<MainExampleTable>
					parentTableReferenceInfoBuilder) {
			}
		};
	TableReferenceInfo<MainExampleTable> tableReferenceInfo =
		TableReferenceInfoFactory.create(
			MainExampleTable.CLASS_NAME_ID,
			MainExampleTable.INSTANCE.mainExampleId,
			tableReferenceDefinition);
	Assert.assertNotNull(tableReferenceInfo);
	Assert.assertSame(
		tableReferenceDefinition,
		tableReferenceInfo.getTableReferenceDefinition());
	Map<Table<?>, List<TableJoinHolder>> childTableJoinHoldersMap =
		tableReferenceInfo.getChildTableJoinHoldersMap();
	Assert.assertEquals(
		childTableJoinHoldersMap.toString(), 1,
		childTableJoinHoldersMap.size());
	List<TableJoinHolder> childJoinHolders = childTableJoinHoldersMap.get(
		ReferenceExampleTable.INSTANCE);
	Assert.assertEquals(
		childJoinHolders.toString(), 1, childJoinHolders.size());
	TableJoinHolder childJoinHolder = childJoinHolders.get(0);
	Assert.assertSame(childJoinFunction, childJoinHolder.getJoinFunction());
	Map<Table<?>, List<TableJoinHolder>> parentTableJoinHoldersMap =
		tableReferenceInfo.getParentTableJoinHoldersMap();
	Assert.assertTrue(
		parentTableJoinHoldersMap.toString(),
		parentTableJoinHoldersMap.isEmpty());
	Assert.assertEquals(
		MainExampleTable.CLASS_NAME_ID,
		tableReferenceInfo.getClassNameId());
}