SystemDataProvider extends BaseModelResolver implements DataProvider { @Override public Object resolvePath(Object target, String path) { if (target == null) { return null; } if (target instanceof Tuple) { return ((Tuple)target).getElement(path); } Class<? extends Object> clazz = target.getClass(); Method accessor = getReadAccessor(clazz, path); if (accessor == null) { return null; } try { return accessor.invoke(target); } catch (InvocationTargetException e) { throw new IllegalArgumentException(String.format("Errors occurred attempting to invoke the accessor function for property %s of type %s", path, clazz.getSimpleName())); } catch (IllegalAccessException e) { throw new IllegalArgumentException(String.format("Could not invoke the accessor function for property %s of type %s", path, clazz.getSimpleName())); } }  @Override Iterable<Object> retrieve(String context, String contextPath, Object contextValue, String dataType,
            String templateId, String codePath, Iterable<Code> codes, String valueSet, String datePath,
            String dateLowPath, String dateHighPath, Interval dateRange); @Override String getPackageName(); @Override void setPackageName(String packageName); @Override Object resolvePath(Object target, String path); void setValue(Object target, String path, Object value); @Override Class<?> resolveType(Object value); @Override Class<?> resolveType(String typeName); @Override Object createInstance(String typeName); @Override Boolean objectEqual(Object left, Object right); @Override Boolean objectEquivalent(Object left, Object right); @Override Object getContextPath(String contextType, String targetType);  }
@Test public void resolveMissingPropertyReturnsNull() { SystemDataProvider provider = new SystemDataProvider(); Date date = new Date(2019, 01, 01); Object result = provider.resolvePath(date, "notapath"); assertNull(result); }