### Question:
PlatformMetadataProvider implements ModelProvider { @Override public PlatformMetadata getModel(DataTypeInfo dataType, DataTypeInfo videoLayer, long time, PlatformMetadata previousMetadata) { DataModelCategory category = new DataModelCategory(dataType.getUrl(), Constants.PLATFORM_METADATA_FAMILY, dataType.getTypeKey()); PropertyMatcher<Long> lte = new NumberPropertyMatcher<Long>(Constants.METADATA_TIMESTAMP_PROPERTY_DESCRIPTOR, OperatorType.LTE, Long.valueOf(time)); PropertyMatcher<Long> gte = new NumberPropertyMatcher<Long>(Constants.METADATA_TIMESTAMP_PROPERTY_DESCRIPTOR, OperatorType.GTE, Long.valueOf(time - 1000)); SimpleQuery<PlatformMetadata> query = new SimpleQuery<>(category, Constants.PLATFORM_METADATA_DESCRIPTOR, New.list(lte, gte)); myDataRegistry.performQuery(query); PlatformMetadata metadata = null; if (query.getResults() != null && !query.getResults().isEmpty()) { for (PlatformMetadata aMetadata : query.getResults()) { if (aMetadata.getTime().getTime() <= time && (metadata == null || metadata.getTime().getTime() < aMetadata.getTime().getTime())) { metadata = aMetadata; } } } return metadata; } PlatformMetadataProvider(DataRegistry dataRegistry); @Override PlatformMetadata getModel(DataTypeInfo dataType, DataTypeInfo videoLayer, long time, PlatformMetadata previousMetadata);  }### Answer:
@Test public void testGetModel() { EasyMockSupport support = new EasyMockSupport(); List<PlatformMetadata> testData = createTestData(); DataRegistry dataRegistry = createRegistry(support, testData); DataTypeInfo dataType = createDataType(support); DataTypeInfo videoLayer = support.createMock(DataTypeInfo.class); support.replayAll(); PlatformMetadataProvider provider = new PlatformMetadataProvider(dataRegistry); PlatformMetadata metadata = provider.getModel(dataType, videoLayer, ourQueryTime, null); assertEquals(testData.get(testData.size() - 1), metadata); support.verifyAll(); }