### Question:
FlumeSpecGen { static String genArg(CommonTree t) throws FlumeSpecException { ASTNODE type = ASTNODE.valueOf(t.getText()); switch (type) { case HEX: case DEC: case BOOL: case OCT: case STRING: case FLOAT: return t.getChild(0).getText(); default: throw new FlumeSpecException("Not a node of literal type: " + t.toStringTree()); } }  @SuppressWarnings("unchecked") static String genEventSource(CommonTree t); @SuppressWarnings("unchecked") static String genEventSink(CommonTree t); @SuppressWarnings("unchecked") static List<FlumeNodeSpec> generate(String s);  }### Answer:
@Test public void testHex() throws RecognitionException, FlumeSpecException { String hex = "0x1234"; CommonTree thex = FlumeBuilder.parseLiteral(hex); String outHex = FlumeSpecGen.genArg(thex); assertEquals(hex, outHex); }
@Test public void testDec() throws RecognitionException, FlumeSpecException { String orig = "12234"; CommonTree tree = FlumeBuilder.parseLiteral(orig); String out = FlumeSpecGen.genArg(tree); assertEquals(orig, out); }
@Test public void testString() throws RecognitionException, FlumeSpecException { String orig = "\"This is a a string\""; CommonTree tree = FlumeBuilder.parseLiteral(orig); String out = FlumeSpecGen.genArg(tree); assertEquals(orig, out); }