package org.example; import java.util.ArrayList; public class InfoManager { private ArrayList infoList; public InfoManager() { // ZDE IMPLEMENTUJ KONSTRUKTOR // Definuj první hodnotu do ArrayListu (jako prázdný list), aby byl inicializován // a nedocházelo k chybě NullPointerException. // Měj na paměti, že bez této definice seznam zůstane prázdný a při pokusu // o přístup (přidání, odebrání prvku) dojde okamžitě k chybě. } // Method to add information public void addInfo(String name) { // TO BE DONE: Add the specified information to the information list } // Method to remove all occurrences of information by name public void removeInfo(String name) { // TO BE DONE: Remove all occurrences of the specified information from the list } // Method to get the count of occurrences of information by name public int getCountByName(String name) { // TO BE DONE: Return the count of occurrences of the specified information in the list return 0; } // Method to check if the list contains a given information public boolean hasInfo(String name) { // TO BE DONE: Return true if the list contains the specified information, otherwise false return false; } // Method to remove all information from the list public void clearInfo() { // TO BE DONE: Clear all information from the list } // Method to get the index of the first occurrence of information by name public int getIndexByName(String name) { // TO BE DONE: Return the index of the first occurrence of the specified information in the list, or -1 if not found return -1; } }