 // A new instance of this class will be created for each *TEST(MapTest, ...)
 // Put all repeated stuff for each test here
 template <class T>
-class MapTest : public testing::Test 
-{
-public:
+struct MapTest : public testing::Test 
+{
   using key_type = typename T::key_type;
   using value_type = typename T::value_type;
-
-
-  concurrent_unordered_map<key_type, 
-                                value_type, 
-                                std::numeric_limits<key_type>::max() > the_map;
+  using map_type = concurrent_unordered_map<key_type, value_type, std::numeric_limits<key_type>::max()>;
+
+  std::unique_ptr<map_type> the_map;
 
   const key_type unused_key = std::numeric_limits<key_type>::max();
   const value_type unused_value = std::numeric_limits<value_type>::max();



  MapTest(const int hash_table_size = 100)
    : the_map(hash_table_size), size(hash_table_size)
  {


  }

  ~MapTest(){


  auto max = [](value_type a, value_type b) { return (a >= b ? a : b); };

  this->the_map->insert(first_pair, max);
  auto found = this->the_map->find(0);
  EXPECT_EQ(0, found->second);

  this->the_map->insert(second_pair, max);
  found = this->the_map->find(0);
  EXPECT_EQ(10, found->second);

  this->the_map->insert(third_pair, max);
  found = this->the_map->find(0);
  EXPECT_EQ(10, found->second);

  this->the_map->insert(thrust::make_pair(0,11), max);
  found = this->the_map->find(0);
  EXPECT_EQ(11, found->second);

  this->the_map->insert(thrust::make_pair(7, 42), max);
  found = this->the_map->find(7);
  EXPECT_EQ(42, found->second);

  this->the_map->insert(thrust::make_pair(7, 62), max);
  found = this->the_map->find(7);
  EXPECT_EQ(62, found->second);

  this->the_map->insert(thrust::make_pair(7, 42), max);
  found = this->the_map->find(7);
  EXPECT_EQ(62, found->second);

  found = this->the_map->find(0);
  EXPECT_EQ(11, found->second);

}
