public void testNestedAllocationContexts(){
  final IAllocationContext context=manager.newAllocationContext(true);
  final String test="Hello World";
  final long addr1=allocate(manager,context,test);
  final long addr2=allocate(manager,context,test);
  assertTrue(addr1 != addr2);
  final String res=getString(addr1);
  assertTrue(res.equals(test));
  manager.free(addr1,context);
  final long addr3=allocate(manager,context,test);
  assertTrue(addr1 != addr3);
  manager.detachContext(context);
  final IAllocationContext context2=manager.newAllocationContext(true);
  final long addr4=allocate(manager,context2,test);
  assertTrue(addr1 == addr4);
}

public void testNestedAllocationContexts ( ) { final IAllocationContext context = manager . newAllocationContext ( true ) ; final String test = "Hello World" ; final long addr1 = allocate ( manager , context , test ) ; final long addr2 = allocate ( manager , context , test ) ; assertTrue ( addr1 != addr2 ) ; final String res = getString ( addr1 ) ; assertTrue ( res . equals ( test ) ) ; manager . free ( addr1 , context ) ; final long addr3 = allocate ( manager , context , test ) ; assertTrue ( addr1 != addr3 ) ; manager . detachContext ( context ) ; final IAllocationContext context2 = manager . newAllocationContext ( true ) ; final long addr4 = allocate ( manager , context2 , test ) ; assertTrue ( addr1 == addr4 ) ; }
rather than creating contexts directly , instead associate with externally created context .
