6465666768697071
public Animal getAnimalById(int id) throws NoAnimalException { Animal animal = mapAnimalById.get(id); if(animal != null){ return animal; }else{ throw new NoAnimalException(); } }
8081828384858687
public Animal getDogByDogName(String name) throws NoDogsNameException { Animal dog = mapDogByName.get(name); if(dog != null){ return dog; }else{ throw new NoDogsNameException(); } }