RulesExporter { void export(Writer writer) throws IOException { writer.write(rulesCurator.getRules().getRules()); } @Inject  RulesExporter(RulesCurator rulesCurator);   }
@Test public void testMetaExporter() throws IOException { RulesCurator rulesCurator = mock(RulesCurator.class); when(rulesCurator.getRules()).thenReturn(new Rules(FAKE_RULES)); RulesExporter exporter = new RulesExporter(rulesCurator); StringWriter writer = new StringWriter(); exporter.export(writer); assertEquals(FAKE_RULES, writer.toString()); }