ComponentPropertyGenerator extends PropertyValueGenerator<Component> { @Override public Component getValue(Item item, Object itemId, Object propertyId) { return componentGenerator.getComponent((T) itemId); } ComponentPropertyGenerator(Class<T> typeOfRows, ComponentGenerator<T> generator); @Override Component getValue(Item item, Object itemId, Object propertyId); @Override SortOrder[] getSortProperties(SortOrder order); @Override Class<Component> getType();  }
@Test public void testGetValue() { ExampleBean bean = new ExampleBean(); bean.setCaption(LABEL_TEST_CAPTION); Label label = (Label) generator.getValue(mock(Item.class), bean, "nocolumn"); assertThat(label.getValue(), is(LABEL_TEST_CAPTION)); Label label2 = (Label) generator.getValue(mock(Item.class), bean, "nocolumn"); assertThat(label, not(sameInstance(label2))); }