PrependPageNumberPrefixProcessor implements PrefixProcessor { @Override public String process(String inputPrefix, NameGenerationRequest request) { if (nonNull(request) && nonNull(request.getPage())) { return String.format("%d_%s", request.getPage(), inputPrefix); } return inputPrefix; }  @Override String process(String inputPrefix, NameGenerationRequest request);  }
@Test public void positive() { assertEquals("34_prefix_", victim.process("prefix_", nameRequest().page(34))); }
@Test public void nullRequest() { assertEquals("prefix_", victim.process("prefix_", null)); }
@Test public void noPage() { assertEquals("prefix_", victim.process("prefix_", nameRequest())); }