PartDEventTransformer { static ExplanationOfBenefit transform(MetricRegistry metricRegistry, Object claim) { Timer.Context timer = metricRegistry .timer(MetricRegistry.name(PartDEventTransformer.class.getSimpleName(), "transform")).time(); if (!(claim instanceof PartDEvent)) throw new BadCodeMonkeyException(); ExplanationOfBenefit eob = transformClaim((PartDEvent) claim); timer.stop(); return eob; }    }
@Test public void transformSampleARecord() throws FHIRException { List<Object> parsedRecords = ServerTestUtils .parseData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources())); PartDEvent claim = parsedRecords.stream().filter(r -> r instanceof PartDEvent).map(r -> (PartDEvent) r) .findFirst().get(); ExplanationOfBenefit eob = PartDEventTransformer.transform(new MetricRegistry(), claim); assertMatches(claim, eob); }