### Question:
CArray extends CValue { @Override public void replace(String key, String resolvedValue) { for (CValue value : data) { value.replace(key, resolvedValue); } } CArray(final List<CValue> data); List<CValue> data(); @Override Set<String> referencedKeys(); @Override void replace(String key, String resolvedValue); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testReplace() throws Exception { final CArray arrayWithKey = new CArray(Arrays.<CValue>asList(new CPrimitive("#{key}"))); assertEquals(1, arrayWithKey.referencedKeys().size()); arrayWithKey.replace("key", VALUE_ONE); assertArrayEquals(new CValue[]{PRIMITIVE_ONE}, arrayWithKey.data().toArray(new CValue[]{})); }