### Question:
ELUtils { public static Property getProperty(ValueExpression valueExpression, ELContext elContext) { Assert.notNull(elContext, "ELContext must not be null"); if (valueExpression == null) { return null; } TrackedELContext trackedContext = new TrackedELContext(elContext); valueExpression.getType(trackedContext); return getProperty(trackedContext); }  static TypeDescriptor getTypeDescriptor(ValueExpression valueExpression, ELContext elContext); static Property getProperty(ValueExpression valueExpression, ELContext elContext);  }### Answer:
@Test public void shouldGetPropertyForNull() throws Exception { Property property = ELUtils.getProperty(null, this.context); assertThat(property, is(nullValue())); }
@Test public void shouldGetProperty() throws Exception { ValueExpression valueExpression = newValueExpression("integer", Object.class); Property property = ELUtils.getProperty(valueExpression, this.context); assertThat(property.getName(), is(equalTo("integer"))); assertThat(property.getObjectType(), is(equalTo((Class) Bean.class))); }
@Test public void shouldGetNestedProperty() throws Exception { ValueExpression valueExpression = newValueExpression("nested.collectionOfInteger", Object.class); Property property = ELUtils.getProperty(valueExpression, this.context); assertThat(property.getName(), is(equalTo("collectionOfInteger"))); assertThat(property.getObjectType(), is(equalTo((Class) NestedBean.class))); }
@Test public void shouldGetNullPropertyIfMissing() throws Exception { ValueExpression valueExpression = new ExpressionBuilder("#{bean}", this.context) .createValueExpression(Object.class); Property property = ELUtils.getProperty(valueExpression, this.context); assertThat(property, is(nullValue())); }