public void testLocalscopePutDoesntLeakButGetDoes()
{
VelocityContext base = new VelocityContext();
base.put("outsideVar", "value1");
VMContext vm = new VMContext(new InternalContextAdapterImpl(base), this.instance);
vm.put("newLocalVar", "value2");
// New variable put doesn't leak
assertNull(base.get("newLocalVar"));
assertEquals("value2", vm.get("newLocalVar"));
// But we can still get to "outsideVar"
assertEquals("value1", vm.get("outsideVar"));
// If we decide to try and set outsideVar it won't leak
vm.put("outsideVar", "value3");
assertEquals("value3", vm.get("outsideVar"));
assertEquals("value1", base.get("outsideVar"));
}