### Question:
InLogFactory { public static InLog newInstance(Log.in logIn, List<Printer> printers) { return new InLog( AnnotationAttribute.LEVEL.extract(logIn), logIn.ifEnabled(), logIn.verbose(), printers ); }  static InLog newInstance(Log.in logIn, List<Printer> printers);  }### Answer:
@Test public void newInstance() { Log.in logIn = givenLogIn(); ToStringPrinter printer = new ToStringPrinter(); List<Printer> printers = singletonList(printer); InLog inLog = InLogFactory.newInstance(logIn, printers); assertThat(inLog.getLevel(), is(WARN)); assertThat(inLog.getIfEnabledLevel(), is(WARN)); assertThat(inLog.getVerboseLevel(), is(TRACE)); assertThat(inLog.getPrinters(), hasSize(1)); assertThat(inLog.getPrinters().get(0), is(printer)); }
@Test public void newInstanceByValue() { Log.in logIn = givenLogInByValue(); ToStringPrinter printer = new ToStringPrinter(); List<Printer> printers = singletonList(printer); InLog inLog = InLogFactory.newInstance(logIn, printers); assertThat(inLog.getLevel(), is(WARN)); }
@Test(expected = UnsupportedOperationException.class) public void newInstancePrintersImmutable() { Log.in logIn = givenLogIn(); ToStringPrinter printer = new ToStringPrinter(); List<Printer> printers = singletonList(printer); InLog inLog = InLogFactory.newInstance(logIn, printers); inLog.getPrinters().add(PrinterResolver.defaultPrinter); }