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