COMPILING
javac -classpath commons-collections-3.2.1.jar  *.java

RUNNING
java -classpath commons-collections-3.2.1.jar:. Main $QUERY_FILE $RESPONSES_DIR [$OUTPUT_FORMAT] [$DNS_LIB]

ARGUMENTS
 - $QUERY_FILE (required): Is the path to the query file generated by the
   response collector

 - $RESPONSES_DIR (required): Is the path to the directory containing the .fpr
   response files to be used to generate the tree

 - $OUTPUT_FORMAT (optional): Specifies what format the output should be in.
    Can be either "xml" or "perlFPDNS". Defaults to "perlFPDNS" when not specified

 - $DNS_LIB (optional): Specifies what DNS library the generated tree will be
   supported by. Can be either "ruby" or "perl". Defaults to "perl" when not specified


IMPORTANT!!
Manually move the responses that use wildcards to the bottom of the xml fingerprint tree

e.g.
 <responses>
    <response id="0">1,0,0,0,0,0,0,0,0,.+,.+,.+,.+</response>
    <response id="1">1,0,0,0,0,0,0,0,2,1,0,0,0</response>
    <response id="2">1,0,0,0,0,0,0,0,3,1,0,0,0</response>
    <response id="3">1,0,0,0,0,0,0,0,0,1,0,0,0</response>
    <response id="4">1,0,0,0,0,1,0,0,0,.+,.+,.+,.+</response>
    <response id="5">1,2,0,0,1,1,0,0,2,1,0,0,0</response>
    <response id="6">1,2,0,0,1,1,0,0,4,0,0,0,0</response>
    <response id="7">1,0,0,0,1,1,0,1,0,.+,.+,.+,.+</response>
    <response id="8">1,0,0,0,1,0,0,0,2,1,0,0,0</response>
    <response id="9">1,0,0,0,1,0,0,0,5,1,0,0,0</response>
    <response id="10">1,0,0,0,1,1,0,0,0,.+,.+,.+,.+</response>
    <response id="11">1,1,0,0,0,1,0,1,4,0,0,0,0</response>
    <response id="12">1,1,0,0,0,1,0,0,4,0,0,0,0</response>
    <response id="13">1,0,0,0,1,1,0,0,4,.+,.+,.+,.+</response>
    <response id="14">0,2,0,0,1,1,1,0,0,1,0,0,0</response>
    <response id="15">1,0,1,0,0,0,0,1,0,.+,.+,.+,.+</response>
    <response id="16">1,0,0,0,1,1,0,0,2,1,0,0,0</response>
    <response id="17">1,1,0,0,0,1,0,0,4,1,0,0,0</response>
    <response id="18">0,1,0,0,0,1,1,0,0,1,0,0,0</response>
    <response id="19">1,0,0,0,1,0,0,0,4,1,0,0,0</response>
    <response id="20">0,0,0,0,1,0,0,0,0,1,0,0,0</response>
    <response id="21">0,1,0,0,0,1,0,1,4,1,0,0,0</response>
    <response id="22">1,0,0,0,0,0,0,0,5,0,0,0,0</response>
    <response id="23">1,0,0,0,1,1,0,0,5,1,0,0,0</response>
  </responses>

should be re-arranged to be

    <response id="1">1,0,0,0,0,0,0,0,2,1,0,0,0</response>
    <response id="2">1,0,0,0,0,0,0,0,3,1,0,0,0</response>
    <response id="3">1,0,0,0,0,0,0,0,0,1,0,0,0</response>
    <response id="5">1,2,0,0,1,1,0,0,2,1,0,0,0</response>
    <response id="6">1,2,0,0,1,1,0,0,4,0,0,0,0</response>
    <response id="8">1,0,0,0,1,0,0,0,2,1,0,0,0</response>
    <response id="9">1,0,0,0,1,0,0,0,5,1,0,0,0</response>
    <response id="11">1,1,0,0,0,1,0,1,4,0,0,0,0</response>
    <response id="12">1,1,0,0,0,1,0,0,4,0,0,0,0</response>
    <response id="14">0,2,0,0,1,1,1,0,0,1,0,0,0</response>
    <response id="16">1,0,0,0,1,1,0,0,2,1,0,0,0</response>
    <response id="17">1,1,0,0,0,1,0,0,4,1,0,0,0</response>
    <response id="18">0,1,0,0,0,1,1,0,0,1,0,0,0</response>
    <response id="19">1,0,0,0,1,0,0,0,4,1,0,0,0</response>
    <response id="20">0,0,0,0,1,0,0,0,0,1,0,0,0</response>
    <response id="21">0,1,0,0,0,1,0,1,4,1,0,0,0</response>
    <response id="22">1,0,0,0,0,0,0,0,5,0,0,0,0</response>
    <response id="23">1,0,0,0,1,1,0,0,5,1,0,0,0</response>
    <response id="0">1,0,0,0,0,0,0,0,0,.+,.+,.+,.+</response>
    <response id="15">1,0,1,0,0,0,0,1,0,.+,.+,.+,.+</response>
    <response id="4">1,0,0,0,0,1,0,0,0,.+,.+,.+,.+</response>
    <response id="7">1,0,0,0,1,1,0,1,0,.+,.+,.+,.+</response>
    <response id="10">1,0,0,0,1,1,0,0,0,.+,.+,.+,.+</response>
    <response id="13">1,0,0,0,1,1,0,0,4,.+,.+,.+,.+</response>
  </responses>

If this is not done, the likelihood of a server being misidentified increases.

This is not a problem with the generated perl code YET, but something similar
will eventually have to be done too if the tree keeps growing. A re-arrange won't
be as simple in perl as it is in XML though because the fingerprint tree references
the responses by query index.