public void testTripleAlpha() {
final CompositeObjectSinkAdapter ad = new CompositeObjectSinkAdapter();
final LiteralConstraint lit = new LiteralConstraint( new MockExtractor(),
StringFactory.getInstance().getEvaluator( Operator.EQUAL ),
new ObjectFieldImpl( "stilton" ) );
final AlphaNode al = new AlphaNode( 0,
lit,
new MockObjectSource( 0 ),
true,
3 );
ad.addObjectSink( al );
assertNull( ad.otherSinks );
assertNotNull( ad.hashedFieldIndexes );
assertEquals( 1,
ad.hashableSinks.size() );
assertEquals( al,
ad.getSinks()[0] );
final LiteralConstraint lit2 = new LiteralConstraint( new MockExtractor(),
StringFactory.getInstance().getEvaluator( Operator.EQUAL ),
new ObjectFieldImpl( "cheddar" ) );
final AlphaNode al2 = new AlphaNode( 1,
lit2,
new MockObjectSource( 1 ),
true,
3 );
ad.addObjectSink( al2 );
assertNull( ad.hashedSinkMap );
assertEquals( 2,
ad.hashableSinks.size() );
final LiteralConstraint lit3 = new LiteralConstraint( new MockExtractor(),
StringFactory.getInstance().getEvaluator( Operator.EQUAL ),
new ObjectFieldImpl( "stinky" ) );
final AlphaNode al3 = new AlphaNode( 1,
lit3,
new MockObjectSource( 2 ),
true,
3 );