public void makeReadOnly()
  {
    key.data().makeReadOnly();

    if (params != null)
    {
      params.data().makeReadOnly();
    }
  }
@Test
  public void testMakeReadOnly()
  {
    DataMap keyDataMap = new DataMap();
    keyDataMap.put("key", "key-value");
    EmptyRecord key = new EmptyRecord(keyDataMap);

    DataMap paramsDataMap = new DataMap();
    paramsDataMap.put("params", "params-value");
    EmptyRecord params = new EmptyRecord(paramsDataMap);

    ComplexResourceKey<EmptyRecord, EmptyRecord> complexResourceKey =
        new ComplexResourceKey<>(key, params);

    complexResourceKey.makeReadOnly();

    try
    {
      key.data().put("key", "new key value");
      Assert.fail("Should not be able to update the key after the ComplexResourceKey has been made read only!");
    }
    catch (UnsupportedOperationException e)
    {

    }

    try
    {
      params.data().put("params", "new params value");
      Assert.fail("Should not be able to update the params after the ComplexResourceKey has been made read only!");
    }
    catch (UnsupportedOperationException e)
    {

    }
  }