### Question:
VariableInterpolation { public static <T> T interpolate(final Map<String, Object> values, final T object) { interpolator.setDefaultLookup(new MapOfMapStrLookup(values)); return proxy(object); } private  VariableInterpolation(); static T interpolate(final Map<String, Object> values,
                                    final T object); static T proxy(final T instance);  }### Answer:
@Test public void basicTest() { final Test1 object = new Test1() { }; final Test1 newObject = VariableInterpolation.interpolate(new HashMap<String, Object>() {{ put("input", new HashMap<String, String>() {{ put("value1", "myvalue1"); put("value2", "myvalue2"); }}); }}, object); assertEquals("myvalue1", newObject.getValue1()); assertEquals("myvalue2", newObject.getValue2()); assertEquals("myvalue1", newObject.getValue3()); }
@Test public void missingContentTest() { final Test1 object = new Test1() { }; final Test1 newObject = VariableInterpolation.interpolate(new HashMap<String, Object>() {{ put("input", new HashMap<String, String>() {{ put("value2", "myvalue2"); }}); }}, object); assertEquals("", newObject.getValue1()); assertEquals("myvalue2", newObject.getValue2()); assertEquals("", newObject.getValue3()); }
@Test public void testPreserveImplementedInterfaces() { Object object = new Test1Class(); Object newObject = VariableInterpolation.interpolate(new HashMap<>(), object); assertTrue(newObject instanceof Test1); object = new Test2Class(); newObject = VariableInterpolation.interpolate(new HashMap<>(), object); assertTrue(newObject instanceof Test1); object = new Test3Class(); newObject = VariableInterpolation.interpolate(new HashMap<>(), object); assertTrue(newObject instanceof Test1); }