// Path: retired/currencies/src/main/java/org/javamoney/currencies/spi/CurrencyUnitNamespaceProviderSpi.java
// public interface CurrencyUnitNamespaceProviderSpi {
// 
//     /**
//      * Access the namespaces this provider defines. An instance of
//      * {@link CurrencyUnitNamespaceProviderSpi} may define multiple namespaces containing
//      * {@link CurrencyUnit}. Nevertheless multiple implementations of
//      * Additionally a {@link CurrencyUnit} may be part of multiple namespaces,
//      * if they do not conflict related to their currency code or numericCode (if
//      * defined).
//      *
//      * @return the namespaces that this provider defines, never {@code null}.
//      */
//     public Collection<String> getNamespaces();
// 
//     /**
//      * Access all {@link CurrencyUnit} instances.
//      *
//      * @param namespace The target namespace, never {@code null}.
//      * @return the {@link CurrencyUnit} instances known to this provider
//      * instance, never {@code null}. If the provider can not provide a
//      * full list of all currencies an empty {@link Collection} should be
//      * returned.
//      */
//     public Collection<CurrencyUnit> getCurrencies(String namespace);
// 
//     /**
//      * Checks if a given namespace is known to this provider.
//      *
//      * @param namespace the namespace id, not {@code null}.
//      * @return {@code true} if the namespace is served by this provider.
//      */
//     public boolean isNamespaceAvailable(String namespace);
// 
//     /**
//      * Reverse mapping of a currencyCode to its namespaces.
//      *
//      * @param currencyCode the currencyCode, not {@code null}
//      * @return the set of namespaces for the given code, never {@code null}.
//      */
//     public Set<String> getNamespaces(String currencyCode);
// 
// }
// 
// Path: retired/currencies/src/main/java/org/javamoney/currencies/spi/CurrencyMappingsSingletonSpi.java
// public interface CurrencyMappingsSingletonSpi {
// 
//     /**
//      * This method allows to evaluate, if the given currency namespace is
//      * defined. {@code "ISO-4217"} should be defined in all environments
//      * (default).
//      *
//      * @param namespace the required namespace
//      * @return {@code true}, if the namespace exists.
//      */
//     public boolean isNamespaceAvailable(String namespace);
// 
//     /**
//      * This method allows to access all namespaces currently defined.
//      * {@code "ISO-4217"} should be defined in all environments (default).
//      *
//      * @return the array of currently defined namespace.
//      */
//     public Set<String> getNamespaces();
// 
//     /**
//      * This method maps the given {@link CurrencyUnit} to another
//      * {@link CurrencyUnit} with the given target namespace.
//      *
//      * @param currencyUnit    The source {@link CurrencyUnit}, never {@code null}.
//      * @param targetNamespace the target namespace, never {@code null}.
//      * @return The mapped {@link CurrencyUnit}, or {@code null}.
//      */
//     public CurrencyQuery getMappingQuery(CurrencyUnit currencyUnit,
//                                          String targetNamespace);
// 
//     /**
//      * Access all currencies for a given namespace.
//      *
//      * @param namespace The target namespace, not {@code null}.
//      * @return The currencies found, never {@code null}.
//      * @throws javax.money.UnknownCurrencyException if the required namespace is not defined.
//      * @see #getNamespaces()
//      */
//     public CurrencyQuery getNamespaceQuery(String namespace);
// 
//     /**
//      * Evaluates the currency namespace of a currency code.
//      *
//      * @param code The currency code.
//      * @return {@code true}, if the currency is defined.
//      */
//     public Set<String> getNamespaces(String code);
// 
//     /**
//      * Evaluates the currency namespace of a currency code.
//      *
//      * @param currency The currency, not null.
//      * @return {@code true}, if the currency is defined.
//      */
//     public Set<String> getNamespaces(CurrencyUnit currency);
// 
// }


import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.ServiceLoader;
import java.util.Set;
import javax.inject.Singleton;
import javax.money.CurrencyUnit;
import javax.money.MonetaryCurrencies;
import org.javamoney.currencies.spi.CurrencyUnitNamespaceProviderSpi;
import org.javamoney.currencies.spi.CurrencyMappingsSingletonSpi;
import java.util.Currency;
package org.javamoney.currencies.internal;





/**
 * Default implementation of {@link CurrencyMappingsSingletonSpi}, active
 * if no instance of {@link CurrencyMappingsSingletonSpi} was registered
 * using the {@link ServiceLoader}.
 * 
 * @author Anatole Tresch
 */
@Singleton
public class ISOCurrencyNamespaceProvider implements
// Path: retired/currencies/src/main/java/org/javamoney/currencies/spi/CurrencyUnitNamespaceProviderSpi.java
// public interface CurrencyUnitNamespaceProviderSpi {
// 
//     /**
//      * Access the namespaces this provider defines. An instance of
//      * {@link CurrencyUnitNamespaceProviderSpi} may define multiple namespaces containing
//      * {@link CurrencyUnit}. Nevertheless multiple implementations of
//      * Additionally a {@link CurrencyUnit} may be part of multiple namespaces,
//      * if they do not conflict related to their currency code or numericCode (if
//      * defined).
//      *
//      * @return the namespaces that this provider defines, never {@code null}.
//      */
//     public Collection<String> getNamespaces();
// 
//     /**
//      * Access all {@link CurrencyUnit} instances.
//      *
//      * @param namespace The target namespace, never {@code null}.
//      * @return the {@link CurrencyUnit} instances known to this provider
//      * instance, never {@code null}. If the provider can not provide a
//      * full list of all currencies an empty {@link Collection} should be
//      * returned.
//      */
//     public Collection<CurrencyUnit> getCurrencies(String namespace);
// 
//     /**
//      * Checks if a given namespace is known to this provider.
//      *
//      * @param namespace the namespace id, not {@code null}.
//      * @return {@code true} if the namespace is served by this provider.
//      */
//     public boolean isNamespaceAvailable(String namespace);
// 
//     /**
//      * Reverse mapping of a currencyCode to its namespaces.
//      *
//      * @param currencyCode the currencyCode, not {@code null}
//      * @return the set of namespaces for the given code, never {@code null}.
//      */
//     public Set<String> getNamespaces(String currencyCode);
// 
// }
// 
// Path: retired/currencies/src/main/java/org/javamoney/currencies/spi/CurrencyMappingsSingletonSpi.java
// public interface CurrencyMappingsSingletonSpi {
// 
//     /**
//      * This method allows to evaluate, if the given currency namespace is
//      * defined. {@code "ISO-4217"} should be defined in all environments
//      * (default).
//      *
//      * @param namespace the required namespace
//      * @return {@code true}, if the namespace exists.
//      */
//     public boolean isNamespaceAvailable(String namespace);
// 
//     /**
//      * This method allows to access all namespaces currently defined.
//      * {@code "ISO-4217"} should be defined in all environments (default).
//      *
//      * @return the array of currently defined namespace.
//      */
//     public Set<String> getNamespaces();
// 
//     /**
//      * This method maps the given {@link CurrencyUnit} to another
//      * {@link CurrencyUnit} with the given target namespace.
//      *
//      * @param currencyUnit    The source {@link CurrencyUnit}, never {@code null}.
//      * @param targetNamespace the target namespace, never {@code null}.
//      * @return The mapped {@link CurrencyUnit}, or {@code null}.
//      */
//     public CurrencyQuery getMappingQuery(CurrencyUnit currencyUnit,
//                                          String targetNamespace);
// 
//     /**
//      * Access all currencies for a given namespace.
//      *
//      * @param namespace The target namespace, not {@code null}.
//      * @return The currencies found, never {@code null}.
//      * @throws javax.money.UnknownCurrencyException if the required namespace is not defined.
//      * @see #getNamespaces()
//      */
//     public CurrencyQuery getNamespaceQuery(String namespace);
// 
//     /**
//      * Evaluates the currency namespace of a currency code.
//      *
//      * @param code The currency code.
//      * @return {@code true}, if the currency is defined.
//      */
//     public Set<String> getNamespaces(String code);
// 
//     /**
//      * Evaluates the currency namespace of a currency code.
//      *
//      * @param currency The currency, not null.
//      * @return {@code true}, if the currency is defined.
//      */
//     public Set<String> getNamespaces(CurrencyUnit currency);
// 
// }


// Path: retired/currencies/src/main/java/org/javamoney/currencies/internal/ISOCurrencyNamespaceProvider.java
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.ServiceLoader;
import java.util.Set;
import javax.inject.Singleton;
import javax.money.CurrencyUnit;
import javax.money.MonetaryCurrencies;
import org.javamoney.currencies.spi.CurrencyUnitNamespaceProviderSpi;
import org.javamoney.currencies.spi.CurrencyMappingsSingletonSpi;
import java.util.Currency;

package org.javamoney.currencies.internal;





/**
 * Default implementation of {@link CurrencyMappingsSingletonSpi}, active
 * if no instance of {@link CurrencyMappingsSingletonSpi} was registered
 * using the {@link ServiceLoader}.
 * 
 * @author Anatole Tresch
 */
@Singleton
public class ISOCurrencyNamespaceProvider implements
		CurrencyUnitNamespaceProviderSpi {