### Question:
ParameterLogFactory { public static ParameterLog newInstance(Log log, Printer printer) { return new ParameterLog( AnnotationAttribute.LEVEL.extract(log), log.ifEnabled(), log.verbose(), printer ); }  static ParameterLog newInstance(Log log, Printer printer);  }### Answer:
@Test public void newInstance() { Log log = givenLog(); Printer printer = givenPrinter(); ParameterLog parameterLog = ParameterLogFactory.newInstance(log, printer); assertThat(parameterLog.getLevel(), is(INFO)); assertThat(parameterLog.getIfEnabledLevel(), is(WARN)); assertThat(parameterLog.getVerboseLevel(), is(ERROR)); assertThat(parameterLog.getPrinter(), is(printer)); }
@Test public void newInstanceByValue() { Log log = givenLogByValue(); Printer printer = givenPrinter(); ParameterLog parameterLog = ParameterLogFactory.newInstance(log, printer); assertThat(parameterLog.getLevel(), is(WARN)); }
@Test(expected = NullPointerException.class) public void newInstanceNull() { Log log = null; Printer printer = givenPrinter(); ParameterLog parameterLog = ParameterLogFactory.newInstance(log, printer); assertThat(parameterLog, nullValue()); }