m.put("floating", new Float(100.012));
m.put("long", new Long(10000000000000l));
m.put("boolean", true);
Tuple input = TupleFactory.getInstance().newTuple(m);
INVERSEMAP inverseMap = new INVERSEMAP();
Map inverse = inverseMap.exec(input);
assertEquals(inverse.size(), 7);
assertTrue(inverse.containsKey("apache"));
assertTrue(inverse.containsKey("hadoop"));
assertTrue(inverse.containsKey("pig"));
assertTrue(inverse.containsKey("100"));
assertTrue(inverse.containsKey("true"));
assertTrue(inverse.containsKey("100.012"));
//Test when values are non-unique
m.clear();
m.put("open", "apache");
m.put("1", "hadoop");
m.put("source", "apache");
input.set(0, m);
inverse = inverseMap.exec(input);
assertEquals(inverse.size(), 2);
assertTrue(inverse.containsKey("apache"));
assertTrue(inverse.containsKey("hadoop"));
DataBag bag = (DataBag)inverse.get("apache");