Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void freeFrozenMemory()
        internal virtual void FreeFrozenMemory()
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.memory.MemoryAllocationTracker memoryTrackerSpy = spy(new org.neo4j.memory.LocalMemoryTracker());
            MemoryAllocationTracker memoryTrackerSpy = spy(new LocalMemoryTracker());
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final MutableLinearProbeLongHashSet set2 = new MutableLinearProbeLongHashSet(new OffHeapMemoryAllocator(memoryTrackerSpy, blockAllocator));
            MutableLinearProbeLongHashSet set2 = new MutableLinearProbeLongHashSet(new OffHeapMemoryAllocator(memoryTrackerSpy, _blockAllocator));

            verify(memoryTrackerSpy).allocated(anyLong());

            set2.AddAll(100, 200, 300);
            set2.Freeze();
            set2.Remove(100);
            set2.Freeze();
            set2.Clear();
            set2.Close();
            verify(memoryTrackerSpy, times(3)).deallocated(anyLong());
        }