In pratica quando inserisco il codice bevanda e il codice tessera, il metodo decrementa di 1 le bevande in base alla quantità e calcola il credito in base al prezzo che è stato fornito dal codice tessera.
e infine deve stampare.
quando ho fatto il debag mi ha trovato due valori null, che sono:
Tessera tesseraCredito = getCodiceTessera(tessera); //null
		double creditoTessera = tesseraCredito.getCredito(); //null
questo è il mio main:
public class TestDistributore {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String scriviCodiceBevanda = "";
		int scriviCodiceTessera = 0;
		
		// Esercizio 1
		// Riempiere la tabella con le Mappe BEVANDE
		System.out.println("CATEGORIA BEVANDE");
		HashMap<String, Bevande> map1 = new HashMap<>();
		Bevande bevanda1 = new Bevande("a", null, "acqua", 0.20);
		Bevande bevanda2 = new Bevande("b", null, "coca", 0.30);
		Bevande bevanda3 = new Bevande("c", null, "birra", 1.00);
		Bevande bevanda4 = new Bevande("d", null, "sapone", 3.00);
		// Aggiungi nella Mappa
		map1.put(bevanda1.getCodice(), bevanda1);
		map1.put(bevanda2.getCodice(), bevanda2);
		map1.put(bevanda3.getCodice(), bevanda3);
		map1.put(bevanda4.getCodice(), bevanda4);
		// Chiama il metodo aggiungi bevanda che ha una descrizione
		Distributore distributore = new Distributore(map1);
		try {
			distributore.aggiungiBevanda("a", "questa bottiglia contiene l'acqua");
			distributore.aggiungiBevanda("b", "questa bottiglia contiene la coca-cola");
			distributore.aggiungiBevanda("c", "questa bottiglia contiene la birra");
			distributore.aggiungiBevanda("d", "questo sapone è profumato");
			// distributore.aggiungiBevanda("d", "questa bottiglia non esiste"); //gestione
			// errori
		} catch (BevandaNonValida e) {
			e.printStackTrace(); // chiama il mio metodo presonalizzato
		}
		// iterare mappa per mostrare il contenuto CHIAVE e VALORE
		Iterator iterator = map1.entrySet().iterator();
		while (iterator.hasNext()) {
			Map.Entry pEntry = (Entry) iterator.next();
			System.out.println(pEntry.getKey().toString()); // stampa tutte le chiavi
			System.out.println(pEntry.getValue()); // stampa tutti i valori
			System.out.println(((Bevande) pEntry.getValue()).getDescrizione()); // stampa descrizione
			System.out.println("------------------------------------------");
		}
		// Esercizio 2
		System.out.println("CATEGORIA TESSERE");
		Tessera t1 = new Tessera(12, 5.5);
		Tessera t2 = new Tessera(21, 10.0);
		Tessera t3 = new Tessera(99, 0.75);
		Tessera t4 = new Tessera(15, 9.75);
		// riempi le tabelle tessere con le mappe
		HashMap<Integer, Tessera> mTessera = new HashMap<>();
		mTessera.put(t1.getCodice(), t1);
		mTessera.put(t2.getCodice(), t2);
		mTessera.put(t3.getCodice(), t3);
		mTessera.put(t4.getCodice(), t4);
		// chiama il metodo carica tessera
		AggiornaCredito aCredito = new AggiornaCredito(mTessera);
		try {
			aCredito.caricaTessera(12, 300.4); // aggiorna il SALDO
			aCredito.caricaTessera(21, 250.8);
			
			//caricato ben due volte il credito della tessera
			aCredito.caricaTessera(99, 60.0);
			aCredito.caricaTessera(99, 50.0);
			
			aCredito.caricaTessera(15, 100.0);
		} catch (TesseraNonValida e) {
			e.printStackTrace();
		}
		// Mostra il saldo totale tramite la chiave
		Iterator iteratoreTessera = mTessera.entrySet().iterator();
		while (iteratoreTessera.hasNext()) {
			Map.Entry mEntry = (Entry) iteratoreTessera.next();
			System.out.println("La chiave: " + mEntry.getKey());
			System.out.println(mEntry.getValue().toString()); // saldo totale
		}
		// Esercizio 3
		System.out.println();
		System.out.println("AGGIORNA COLONNA DISTRIBUTORE");
		int codiceA, codiceB, codiceC, codiceD;
		// codice A
		distributore.aggiornaColonna("a", 40);
		// codice A --> ripeto di nuovo per verificare se fa la somma
		distributore.aggiornaColonna("a", 20); // totale lattine = 60
		codiceA = distributore.lattineDisponibili("a");
		// codice B
		distributore.aggiornaColonna("b", 100);
		distributore.aggiornaColonna("b", 50); // totale lattine = 150
		codiceB = distributore.lattineDisponibili("b");
		// codice C
		distributore.aggiornaColonna("c", 20);
		distributore.aggiornaColonna("c", 210);
		distributore.aggiornaColonna("c", 210);
		
		codiceC = distributore.lattineDisponibili("c");
		// codiceD
		distributore.aggiornaColonna("d", 30);
		codiceD = distributore.lattineDisponibili("d");
		
		System.out.println(distributore);
		// ESERCIZIO 4
		System.out.println("***EROGA***");
		System.out.println("Inserisci il codice della bevanda: ");
		scriviCodiceBevanda = in.nextLine();
		System.out.println("Inserisci il codice della tessera: ");
		scriviCodiceTessera = in.nextInt();
		
		try {
			distributore.eroga(scriviCodiceBevanda, scriviCodiceTessera);
		} catch (CreditoInsufficiente | BevandaEsaurita e) {
			e.printStackTrace();
		}
	}