### Question:
JPAContainerItem implements EntityItem<T> { public EntityItemProperty getItemProperty(Object id) { assert id != null : "id must not be null"; ItemProperty p = propertyMap.get(id); if (p == null) { if (!getItemPropertyIds().contains(id.toString())) { return null; } p = new ItemProperty(id.toString()); propertyMap.put(id, p); } return p; } JPAContainerItem(JPAContainer<T> container, T entity);   JPAContainerItem(JPAContainer<T> container, T entity, Object itemId,
            boolean persistent); Object getItemId(); boolean addItemProperty(Object id, Property property); void addNestedContainerProperty(String nestedProperty); EntityItemProperty getItemProperty(Object id); Collection<String> getItemPropertyIds(); boolean removeItemProperty(Object id); boolean isModified(); boolean isDirty(); boolean isPersistent(); boolean isDeleted(); EntityContainer<T> getContainer(); T getEntity(); void commit(); void discard(); boolean isReadThrough(); boolean isWriteThrough(); void setReadThrough(boolean readThrough); void setWriteThrough(boolean writeThrough); void addListener(ValueChangeListener listener); void removeListener(ValueChangeListener listener); void addValueChangeListener(ValueChangeListener listener); void removeValueChangeListener(ValueChangeListener listener); @Override String toString(); @SuppressWarnings("serial") void refresh(); void setBuffered(boolean buffered); boolean isBuffered();  }### Answer:
@Test public void testGetItemProperty() { assertNotNull(item.getItemProperty("firstName")); assertNull(item.getItemProperty("nonexistent")); }
@Test public void testPropertyType() { assertEquals(String.class, item.getItemProperty("firstName").getType()); assertEquals(Date.class, item.getItemProperty("dateOfBirth").getType()); assertEquals(String.class, item.getItemProperty("address.street") .getType()); assertEquals(Address.class, item.getItemProperty("address").getType()); assertEquals(Person.class, item.getItemProperty("manager").getType()); assertEquals(Boolean.class, item.getItemProperty("male").getType()); assertEquals(Double.class, item.getItemProperty("primitiveDouble") .getType()); }
@Test public void testPropertyReadOnly() { assertFalse(item.getItemProperty("firstName").isReadOnly()); assertFalse(item.getItemProperty("address.street").isReadOnly()); assertTrue(item.getItemProperty("fullName").isReadOnly()); assertTrue(item.getItemProperty("address.fullAddress").isReadOnly()); }
@Test public void testPropertyValueFromString_Unbuffered() { final Property prop = item.getItemProperty("id"); assertEquals(123l, prop.getValue()); prop.setValue("1234"); assertEquals(1234l, prop.getValue()); }
@Test(expected = ReadOnlyException.class) public void testPropertyValue_Unbuffered_ReadOnly_throwsException() { entity.setFirstName("Joe"); entity.setLastName("Cool"); item.getItemProperty("fullName").setValue("Blah"); }