### Question:
NonEmptyStringAnnotationFormatterFactory implements
        AnnotationFormatterFactory<NonEmpty> { @Override public Printer<String> getPrinter(NonEmpty annotation, Class<?> fieldType) { return new Printer<String>() { @Override public String print(String object, Locale locale) { if (object == null) { return "null"; } else { return object; } } }; } NonEmptyStringAnnotationFormatterFactory(); @Override final Set<Class<?>> getFieldTypes(); @Override Printer<String> getPrinter(NonEmpty annotation, Class<?> fieldType); @Override Parser<String> getParser(NonEmpty annotation, Class<?> fieldType);  }### Answer:
@Test public void testGetPrinter() { final String anyString = "Foo"; Printer<String> printer = testee.getPrinter(null, String.class); assertThat(printer.print(null, Locale.getDefault())).isEqualTo("null"); assertThat(printer.print(anyString, null)).isEqualTo(anyString); }