@Test public void testAddPrintFunction() { PrintFunctionLibrary library = new PrintFunctionLibrary(); assertThrows(NullPointerException.class, () -> library.add("test", null), "No function was given"); assertThrows(NullPointerException.class, () -> library.add(null, testFunction), "No name was given"); }
public void add(String funcName, PrintFunction func) { if (func == null || funcName == null) throw new NullPointerException(L.m("Weder Funktionsname noch Funktion darf null sein")); mapIdToFunction.put(funcName, func); }
PrintFunctionLibrary { public void add(String funcName, PrintFunction func) { if (func == null || funcName == null) throw new NullPointerException(L.m("Weder Funktionsname noch Funktion darf null sein")); mapIdToFunction.put(funcName, func); } }
PrintFunctionLibrary { public void add(String funcName, PrintFunction func) { if (func == null || funcName == null) throw new NullPointerException(L.m("Weder Funktionsname noch Funktion darf null sein")); mapIdToFunction.put(funcName, func); } PrintFunctionLibrary();  PrintFunctionLibrary(PrintFunctionLibrary baselib); }
PrintFunctionLibrary { public void add(String funcName, PrintFunction func) { if (func == null || funcName == null) throw new NullPointerException(L.m("Weder Funktionsname noch Funktion darf null sein")); mapIdToFunction.put(funcName, func); } PrintFunctionLibrary();  PrintFunctionLibrary(PrintFunctionLibrary baselib); void add(String funcName, PrintFunction func); PrintFunction get(String funcName); Set<String> getFunctionNames(); static PrintFunctionLibrary parsePrintFunctions(ConfigThingy conf); }
PrintFunctionLibrary { public void add(String funcName, PrintFunction func) { if (func == null || funcName == null) throw new NullPointerException(L.m("Weder Funktionsname noch Funktion darf null sein")); mapIdToFunction.put(funcName, func); } PrintFunctionLibrary();  PrintFunctionLibrary(PrintFunctionLibrary baselib); void add(String funcName, PrintFunction func); PrintFunction get(String funcName); Set<String> getFunctionNames(); static PrintFunctionLibrary parsePrintFunctions(ConfigThingy conf);  }