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