### Question:
APIs { void register(String baseName, Object api) { if(!baseName.matches("[a-z_][a-zA-Z_0-9]*")) { throw new IllegalArgumentException("Only JavaScript identifiers are allowed for baseName"); } apis.put(baseName, api); cachedApis = Collections.unmodifiableMap(apis); } APIs(Function<Supplier<Map<String, Object>>, CefMessageRouter> createMessageRouterForApis);   }### Answer:
@Test public void onlyAcceptsValidIdentifiersWhileRegistering() { assertThatThrownBy(() -> new APIs(mock(Function.class)).register("a-b.c", new Object())) .hasMessage("Only JavaScript identifiers are allowed for baseName"); }