Suppose I have the following method:
private boolean isExist(String key) {
return List.of("a", "b", "c", "d", "e").contains(key);
}
Does this create N number of List.of("a", "b", "c", "d", "e") objects for N method executions? Or is there any kind of mechanism like string pool internally?