You need to use ValueFactory and convert key to use a Value interface. It's not really intuitive
// instead of value.get(1) use following
System.out.println(value.get(ValueFactory.createIntegerValue(1)));
// if the key would be a String use:
System.out.println(value.get(ValueFactory.createRawValue("key")));