class PropertyProviderImpl implements PropertyProvider {

    @SuppressWarnings("unchecked")
    @Override
    public Object getProperty(Object object, String propertyName) {
        Function<Object, Object> provider = (Function<Object, Object>) propertyProviders.get(propertyName);
        Preconditions.checkNotNull(provider,
                "Cannot find property '%s' for %s",
                propertyName, object);
        return provider.apply(object);
    }

}