### Question:
MockingPropertyResolver implements PredefinedVariableResolver.NewVariableEncounteredListener { public Object getValue(Object target, Object property) throws GenericElEvaluationException, PropertyNotFoundException { return this.getValue(target, property, getTypeOfCollectionOrBean(target, property)); } MockingPropertyResolver(); void definePropertyTypeOverride(final String elExpression, final Class<?> newType); Class<?> getTypeOfCollectionOrBean(Object target, Object property); Object getValue(Object target, Object property); @SuppressWarnings("rawtypes") Object getValue(final Object target, final Object property, final Class originalType); void handleNewVariableEncountered(final String variableName); void addElExpressionFilter(ElExpressionFilter elExpressionFilter); void clearElExpressionFilters(); void setTypeResolver(PropertyTypeResolver typeResolver);  }### Answer:
@Test public void should_return_MockObjectOfUnknownType_for_existing_list_property_without_declard_component_type() throws Exception { assertThat(resolver.getValue(Collections.EMPTY_LIST, 123) , is(instanceOf(MockObjectOfUnknownType.class))); }
@Test public void should_return_MockObjectOfUnknownType_for_existing_array_property_without_declard_component_type() throws Exception { assertThat(resolver.getValue(new Object[0], 456) , is(instanceOf(MockObjectOfUnknownType.class))); }
@Test public void should_return_string_for_existing_string_array_property() throws Exception { assertThat(resolver.getValue(new String[0], 33) , is(instanceOf(String.class))); }
@Test public void should_allow_any_index_for_indexed_array_property() throws Exception { assertNotNull("Should return a fake value even though no such index in the target" , resolver.getValue(new Object[0], Integer.MAX_VALUE)); assertNotNull("Should return a fake value even though no such index in the target" , resolver.getValue(new Object[0], new Integer(12345))); }
@Test public void should_allow_any_index_for_indexed_collection_property() throws Exception { assertNotNull("Should return a fake value even though no such index in the target" , resolver.getValue(Collections.EMPTY_LIST, Integer.MAX_VALUE)); assertNotNull("Should return a fake value even though no such index in the target" , resolver.getValue(Collections.EMPTY_LIST, new Integer(12345))); }