### Question:
SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; }  @Override @Nullable Object adjust(@Nullable final Object obj); void setModelKey(final String modelKey); String getModelKey();  }### Answer:
@Test public void adjustMap() throws Exception { final Object modelObject = new Object(); final Map<String,Object> map = new HashMap(); map.put("model", modelObject); Assert.assertEquals("should return modelObject", modelObject, springModelAdjuster.adjust(map)); }
@Test public void adjustMapFail() throws Exception { final Object modelObject = new Object(); final Map<String,Object> map = new HashMap(); map.put("model2", modelObject); Assert.assertNull("should return null", springModelAdjuster.adjust(map)); }
@Test public void adjustSpringModel() throws Exception { final Object modelObject = new Object(); final Model model = new ExtendedModelMap(); model.addAttribute("model", modelObject); Assert.assertEquals("should return modelObject", modelObject, springModelAdjuster.adjust(model)); }
@Test public void adjustPassThrough() throws Exception { final Object modelObject = new Object(); Assert.assertEquals("should return modelObject", modelObject, springModelAdjuster.adjust(modelObject)); }