Use a NoopAllocator instead of anonymous class