package com.mindprod.example;
import java.util.Arrays;
import java.util.HashSet;
import static java.lang.System.*;
/**
* example use of java.util.HashSet initialisation.
*
* @author Roedy Green, Canadian Mind Products
* @version 1.0 2012-05-08 initial version
* @since 2012-05-08
*/
public final class TestHashSetInit
{
/**
* initial values for the HashSet
*/
private static final String[] REGIONS = { "WA", "NY", "RI", "BC", "ON" };
/**
* Sample code to TEST and demonstrate the use of HashSet initialisation
*
* @param args not used
*/
public static void main( String[] args )
{
HashSet<String> regions = new HashSet<>( Arrays.asList( REGIONS ) );
out.println( regions.contains( "RI" ) );
}
}