@Test public void formattersMustNotBeNumbers() { Assertions.assertThrows(IllegalArgumentException.class, () -> { CodeFormatter formatter = new CodeFormatter(); formatter.putFormatter('1', CodeFormatterTest::valueOf); }); }
void putFormatter(Character identifier, BiFunction<Object, String, String> formatter) { if (!VALID_FORMATTER_CHARS.contains(identifier)) { throw new IllegalArgumentException("Invalid formatter identifier: " + identifier); } formatters.put(identifier, formatter); }
CodeFormatter { void putFormatter(Character identifier, BiFunction<Object, String, String> formatter) { if (!VALID_FORMATTER_CHARS.contains(identifier)) { throw new IllegalArgumentException("Invalid formatter identifier: " + identifier); } formatters.put(identifier, formatter); } }
CodeFormatter { void putFormatter(Character identifier, BiFunction<Object, String, String> formatter) { if (!VALID_FORMATTER_CHARS.contains(identifier)) { throw new IllegalArgumentException("Invalid formatter identifier: " + identifier); } formatters.put(identifier, formatter); }  }
CodeFormatter { void putFormatter(Character identifier, BiFunction<Object, String, String> formatter) { if (!VALID_FORMATTER_CHARS.contains(identifier)) { throw new IllegalArgumentException("Invalid formatter identifier: " + identifier); } formatters.put(identifier, formatter); }   }
CodeFormatter { void putFormatter(Character identifier, BiFunction<Object, String, String> formatter) { if (!VALID_FORMATTER_CHARS.contains(identifier)) { throw new IllegalArgumentException("Invalid formatter identifier: " + identifier); } formatters.put(identifier, formatter); }    }