@Test
public void testConflictArising() {
HierarchyEncoder encoder = new HierarchyEncoderImpl();
encoder.encode( "A", Collections.EMPTY_LIST );
encoder.encode( "B", Arrays.asList( "A" ) );
encoder.encode( "C", Arrays.asList( "A" ) );
encoder.encode( "D", Arrays.asList( "B" ) );
encoder.encode( "E", Arrays.asList( "B" ) );
encoder.encode( "F", Arrays.asList( "C" ) );
encoder.encode( "G", Arrays.asList( "C" ) );
encoder.encode( "H", Arrays.asList( "E" ) );
System.out.println( encoder );
assertEquals( parseBitSet( "0" ), encoder.getCode( "A" ) );
assertEquals( parseBitSet( "1" ), encoder.getCode( "B" ) );
assertEquals( parseBitSet( "10" ), encoder.getCode( "C" ) );
assertEquals( parseBitSet( "101" ), encoder.getCode( "D" ) );
assertEquals( parseBitSet( "1001" ), encoder.getCode( "E" ) );
assertEquals( parseBitSet( "110" ), encoder.getCode( "F" ) );
assertEquals( parseBitSet( "1010" ), encoder.getCode( "G" ) );
assertEquals( parseBitSet( "11001" ), encoder.getCode( "H" ) );
encoder.encode( "I", Arrays.asList( "E", "F" ) );
System.out.println( encoder );
assertEquals( parseBitSet( "0" ), encoder.getCode( "A" ) );
assertEquals( parseBitSet( "1" ), encoder.getCode( "B" ) );
assertEquals( parseBitSet( "10" ), encoder.getCode( "C" ) );
assertEquals( parseBitSet( "101" ), encoder.getCode( "D" ) );
assertEquals( parseBitSet( "1000001" ), encoder.getCode( "E" ) );
assertEquals( parseBitSet( "100010" ), encoder.getCode( "F" ) );
assertEquals( parseBitSet( "1010" ), encoder.getCode( "G" ) );
assertEquals( parseBitSet( "1010001" ), encoder.getCode( "H" ) );
assertEquals( parseBitSet( "1100011" ), encoder.getCode( "I" ) );
checkHier( encoder, 'I' );
}