// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/CardAndTerminalManager.java
// public enum Protocol {
// 	T0("T=0"), T1("T=1"), TCL("T=CL"), ANY("*");
// 
// 	private final String protocol;
// 
// 	Protocol(String protocol) {
// 		this.protocol = protocol;
// 	}
// 
// 	String getProtocol() {
// 		return protocol;
// 	}
// }
// 
// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/event/BeIDCardEventsListener.java
// public interface BeIDCardEventsListener {
// 	void eIDCardEventsInitialized();
// 
// 	void eIDCardInserted(CardTerminal cardTerminal, BeIDCard card);
// 
// 	void eIDCardRemoved(CardTerminal cardTerminal, BeIDCard card);
// }
// 
// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/event/CardEventsListener.java
// public interface CardEventsListener {
// 	void cardEventsInitialized();
// 
// 	void cardInserted(CardTerminal cardTerminal, Card card);
// 
// 	void cardRemoved(CardTerminal cardTerminal);
// }
// 
// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/impl/LocaleManager.java
// public final class LocaleManager {
// 
// 	private static Locale locale;
// 
// 	private LocaleManager() {
// 		super();
// 	}
// 
// 	public static void setLocale(Locale newLocale) {
// 		LocaleManager.locale = newLocale;
// 	}
// 
// 	public static Locale getLocale() {
// 		if (LocaleManager.locale == null) {
// 			LocaleManager.locale = Locale.getDefault();
// 		}
// 
// 		return LocaleManager.locale;
// 	}
// }
// 
// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/impl/VoidLogger.java
// public final class VoidLogger implements Logger {
// 
// 	public VoidLogger() {
// 		super();
// 	}
// 
// 	@Override
// 	public void error(final String message) {
// 		// empty
// 	}
// 
// 	@Override
// 	public void debug(final String message) {
// 		// empty
// 	}
// }
// 
// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/spi/Logger.java
// public interface Logger {
// 
// 	/**
// 	 * Error messages receiver.
// 	 *
// 	 * @param message the error message.
// 	 */
// 	void error(String message);
// 
// 	/**
// 	 * Debug messages receiver.
// 	 *
// 	 * @param message the debug message.
// 	 */
// 	void debug(String message);
// }


import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import be.bosa.commons.eid.client.CardAndTerminalManager.Protocol;
import be.bosa.commons.eid.client.event.BeIDCardEventsListener;
import be.bosa.commons.eid.client.event.CardEventsListener;
import be.bosa.commons.eid.client.impl.LocaleManager;
import be.bosa.commons.eid.client.impl.VoidLogger;
import be.bosa.commons.eid.client.spi.Logger;
import javax.smartcardio.ATR;
import javax.smartcardio.Card;
import javax.smartcardio.CardTerminal;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
		this(new VoidLogger(), cardAndTerminalManager);
	}

	/**
	 * Instantiate a BeIDCardManager logging to logger, caller supplies a
	 * CardAndTerminalManager. note: caller is responsible for start()in the
	 * supplied CardAndTerminalManager, it will not be automatically started!
	 *
	 * @param logger                 the logger instance
	 * @param cardAndTerminalManager the CardAndTerminalManager to use
	 */
	public BeIDCardManager(Logger logger, CardAndTerminalManager cardAndTerminalManager) {
		this.logger = logger;
		this.beIdListeners = Collections.synchronizedSet(new HashSet<>());
		this.otherCardListeners = Collections.synchronizedSet(new HashSet<>());
		this.terminalsAndCards = Collections.synchronizedMap(new HashMap<>());
		this.cardAndTerminalManager = cardAndTerminalManager;

		this.cardAndTerminalManager.addCardListener(new DefaultCardEventsListener());
	}

	/**
	 * Starts this BeIDCardManager. If no CardAndTerminalManager was given at
	 * construction, this will start our private CardAndTerminalManager. After
	 * this, any registered listeners will start receiving their designated
	 * events, including the existing state. If a CardAndTerminalManager was
	 * given at construction, this has no effect.
	 *
	 * @return this BeIDCardManager to allow for method chaining
	 */
// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/CardAndTerminalManager.java
// public enum Protocol {
// 	T0("T=0"), T1("T=1"), TCL("T=CL"), ANY("*");
// 
// 	private final String protocol;
// 
// 	Protocol(String protocol) {
// 		this.protocol = protocol;
// 	}
// 
// 	String getProtocol() {
// 		return protocol;
// 	}
// }
// 
// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/event/BeIDCardEventsListener.java
// public interface BeIDCardEventsListener {
// 	void eIDCardEventsInitialized();
// 
// 	void eIDCardInserted(CardTerminal cardTerminal, BeIDCard card);
// 
// 	void eIDCardRemoved(CardTerminal cardTerminal, BeIDCard card);
// }
// 
// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/event/CardEventsListener.java
// public interface CardEventsListener {
// 	void cardEventsInitialized();
// 
// 	void cardInserted(CardTerminal cardTerminal, Card card);
// 
// 	void cardRemoved(CardTerminal cardTerminal);
// }
// 
// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/impl/LocaleManager.java
// public final class LocaleManager {
// 
// 	private static Locale locale;
// 
// 	private LocaleManager() {
// 		super();
// 	}
// 
// 	public static void setLocale(Locale newLocale) {
// 		LocaleManager.locale = newLocale;
// 	}
// 
// 	public static Locale getLocale() {
// 		if (LocaleManager.locale == null) {
// 			LocaleManager.locale = Locale.getDefault();
// 		}
// 
// 		return LocaleManager.locale;
// 	}
// }
// 
// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/impl/VoidLogger.java
// public final class VoidLogger implements Logger {
// 
// 	public VoidLogger() {
// 		super();
// 	}
// 
// 	@Override
// 	public void error(final String message) {
// 		// empty
// 	}
// 
// 	@Override
// 	public void debug(final String message) {
// 		// empty
// 	}
// }
// 
// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/spi/Logger.java
// public interface Logger {
// 
// 	/**
// 	 * Error messages receiver.
// 	 *
// 	 * @param message the error message.
// 	 */
// 	void error(String message);
// 
// 	/**
// 	 * Debug messages receiver.
// 	 *
// 	 * @param message the debug message.
// 	 */
// 	void debug(String message);
// }


// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/BeIDCardManager.java
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import be.bosa.commons.eid.client.CardAndTerminalManager.Protocol;
import be.bosa.commons.eid.client.event.BeIDCardEventsListener;
import be.bosa.commons.eid.client.event.CardEventsListener;
import be.bosa.commons.eid.client.impl.LocaleManager;
import be.bosa.commons.eid.client.impl.VoidLogger;
import be.bosa.commons.eid.client.spi.Logger;
import javax.smartcardio.ATR;
import javax.smartcardio.Card;
import javax.smartcardio.CardTerminal;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;

		this(new VoidLogger(), cardAndTerminalManager);
	}

	/**
	 * Instantiate a BeIDCardManager logging to logger, caller supplies a
	 * CardAndTerminalManager. note: caller is responsible for start()in the
	 * supplied CardAndTerminalManager, it will not be automatically started!
	 *
	 * @param logger                 the logger instance
	 * @param cardAndTerminalManager the CardAndTerminalManager to use
	 */
	public BeIDCardManager(Logger logger, CardAndTerminalManager cardAndTerminalManager) {
		this.logger = logger;
		this.beIdListeners = Collections.synchronizedSet(new HashSet<>());
		this.otherCardListeners = Collections.synchronizedSet(new HashSet<>());
		this.terminalsAndCards = Collections.synchronizedMap(new HashMap<>());
		this.cardAndTerminalManager = cardAndTerminalManager;

		this.cardAndTerminalManager.addCardListener(new DefaultCardEventsListener());
	}

	/**
	 * Starts this BeIDCardManager. If no CardAndTerminalManager was given at
	 * construction, this will start our private CardAndTerminalManager. After
	 * this, any registered listeners will start receiving their designated
	 * events, including the existing state. If a CardAndTerminalManager was
	 * given at construction, this has no effect.
	 *
	 * @return this BeIDCardManager to allow for method chaining
	 */
	public BeIDCardManager start() {