### Question:
PrototypeMeasurementFilter implements Predicate<Measurement> { public static PrototypeMeasurementFilter loadFromPath(String path) throws IOException { PrototypeMeasurementFilterSpecification spec = PrototypeMeasurementFilterSpecification.loadFromPath(path); return new PrototypeMeasurementFilter(spec); } PrototypeMeasurementFilter(PrototypeMeasurementFilterSpecification specification); @SuppressWarnings("PMD.JUnit4TestShouldUseTestAnnotation") @Override boolean test(Measurement measurement); IncludeExcludePatterns metricToPatterns(String metric); static PrototypeMeasurementFilter loadFromPath(String path);  }### Answer:
@Test public void loadFromJson() throws IOException { String path = getClass().getResource("/test_measurement_filter.json").getFile(); PrototypeMeasurementFilterSpecification spec = PrototypeMeasurementFilterSpecification.loadFromPath(path); PrototypeMeasurementFilterSpecification specA = new PrototypeMeasurementFilterSpecification(); specA.getInclude().put("meterA", meterSpecA); specA.getInclude().put("meterD", meterSpecD); specA.getInclude().put( "empty", new PrototypeMeasurementFilterSpecification.MeterFilterSpecification( new ArrayList<>())); List<PrototypeMeasurementFilterSpecification.TagFilterSpecification> tagsX = Arrays.asList( new PrototypeMeasurementFilterSpecification.TagFilterSpecification("tagA", "X"), new PrototypeMeasurementFilterSpecification.TagFilterSpecification("tagX", ".*")); PrototypeMeasurementFilterSpecification.ValueFilterSpecification valueSpecX = new PrototypeMeasurementFilterSpecification.ValueFilterSpecification(); valueSpecX.getTags().addAll(tagsX); specA.getExclude().put( ".+", new PrototypeMeasurementFilterSpecification.MeterFilterSpecification( Collections.singletonList(valueSpecX))); Assertions.assertEquals(spec, specA); }