old_contents: import unittest
  from som.vm.globals import trueObject
  from som.vmobjects.array import Array
  from som.vmobjects.array import _EmptyStrategy  # pylint: disable=protected-access
  from som.vmobjects.array import _ObjectStrategy  # pylint: disable=protected-access
  from som.vmobjects.array import _LongStrategy  # pylint: disable=protected-access
  from som.vmobjects.array import _PartiallyEmptyStrategy  # pylint: disable=W
  from som.vmobjects.array import _BoolStrategy  # pylint: disable=protected-access
  
  from som.vmobjects.integer import Integer
  
  
  class ArrayTest(unittest.TestCase):
      def assert_strategy(self, arr, strategy):
          self.assertIsInstance(arr.strategy, strategy)  # pylint: disable=W
  
      def test_empty_array(self):
          arr = Array.from_size(0)
          self.assert_strategy(arr, _EmptyStrategy)
  
      def test_empty_to_obj(self):
          arr = Array.from_size(1)
          self.assert_strategy(arr, _EmptyStrategy)
  
          arr.set_indexable_field(0, arr)
          self.assert_strategy(arr, _ObjectStrategy)
          self.assertIs(arr, arr.get_indexable_field(0))
  
      def test_empty_to_int(self):
          arr = Array.from_size(1)
          self.assert_strategy(arr, _EmptyStrategy)
  
          int_obj = Integer(42)
  
          arr.set_indexable_field(0, int_obj)
          self.assert_strategy(arr, _LongStrategy)
          self.assertEqual(42, arr.get_indexable_field(0).get_embedded_integer())
  
      def test_empty_to_bool(self):
          arr = Array.from_size(1)
          self.assert_strategy(arr, _EmptyStrategy)
  
          arr.set_indexable_field(0, trueObject)
          self.assert_strategy(arr, _BoolStrategy)
          self.assertEqual(trueObject, arr.get_indexable_field(0))
  
      def test_copy_and_extend_partially_empty(self):
          arr = Array.from_size(3)
  
          int_obj = Integer(42)
          arr.set_indexable_field(0, int_obj)
          self.assert_strategy(arr, _PartiallyEmptyStrategy)
          new_arr = arr.copy_and_extend_with(int_obj)
  
          self.assertIsNot(arr, new_arr)
          self.assertEqual(4, new_arr.get_number_of_indexable_fields())
          self.assert_strategy(new_arr, _PartiallyEmptyStrategy)
  
new_contents: from som.vm.globals import trueObject
  from som.vmobjects.array import Array
  from som.vmobjects.array import _empty_strategy  # pylint: disable=protected-access
  from som.vmobjects.array import _obj_strategy  # pylint: disable=protected-access
  from som.vmobjects.array import _long_strategy  # pylint: disable=protected-access
  from som.vmobjects.array import _partially_empty_strategy  # pylint: disable=W
  from som.vmobjects.array import _bool_strategy  # pylint: disable=protected-access
  
  from som.vmobjects.integer import Integer
  
  
  def test_empty_array():
      arr = Array.from_size(0)
      assert arr.strategy is _empty_strategy
  
  
  def test_empty_to_obj():
      arr = Array.from_size(1)
      assert arr.strategy is _empty_strategy
  
      arr.set_indexable_field(0, arr)
      assert arr.strategy is _obj_strategy
      assert arr is arr.get_indexable_field(0)
  
  
  def test_empty_to_int():
      arr = Array.from_size(1)
      assert arr.strategy is _empty_strategy
  
      int_obj = Integer(42)
  
      arr.set_indexable_field(0, int_obj)
      assert arr.strategy is _long_strategy
      assert arr.get_indexable_field(0).get_embedded_integer() == 42
  
  
  def test_empty_to_bool():
      arr = Array.from_size(1)
      assert arr.strategy is _empty_strategy
  
      arr.set_indexable_field(0, trueObject)
      assert arr.strategy is _bool_strategy
      assert trueObject is arr.get_indexable_field(0)
  
  
  def test_copy_and_extend_partially_empty():
      arr = Array.from_size(3)
  
      int_obj = Integer(42)
      arr.set_indexable_field(0, int_obj)
      assert arr.strategy is _partially_empty_strategy
      new_arr = arr.copy_and_extend_with(int_obj)
  
      assert arr is not new_arr
      assert new_arr.get_number_of_indexable_fields() == 4
      assert new_arr.strategy is _partially_empty_strategy
  
subject: Simplify test_array to use PyTest style