@Test
public void testConvertRdef01Strategy() {

    FromCobolChoiceStrategy customChoiceStrategy = new FromCobolChoiceStrategy() {
        public CobolType choose(String choiceFieldName,
                CobolChoiceType choiceType,
                Map < String, Object > variables, byte[] hostData,
                int start, int length) {
            int select = ((Number) variables.get("comSelect"))
                    .intValue();
            switch (select) {
            case 0:
                return choiceType.getAlternatives().get(
                        "ComDetail1");
            case 1:
                return choiceType.getAlternatives().get(
                        "ComDetail2");
            default:
                return null;
            }
        }
        public Set < String > getVariableNames() {
            Set < String > variables = new HashSet < String >();
            variables.add("comSelect");
            return variables;
        }
    };
    
    Cob2AvroSpecificConverter converter = new Cob2AvroSpecificConverter.Builder()
            .cobolComplexType(new legstar.test.avro.rdef01.CobolRdef01Record())
            .schema(getSchema("rdef01"))
            .customChoiceStrategy(customChoiceStrategy)
            .build();
    FromHostResult < SpecificRecord > result = converter.convert(
                    HexUtils.decodeHex("00010250000F40404040404000010260000F404040404040"));
    assertEquals(6, result.getBytesProcessed());
    check(avro2Json(result.getValue()), "result.json");
}