import java.util.BitSet;
...
/**
* list of legal states
*/
public static final String[] possibleStates = {
"AL","AK","AR","AS","AZ","CA","CM","CO","CT","DC",
"DE","FL","GA","GU","HI","IA","ID","IL","IN","KS",
"KY","LA","MA","MD","ME","MI","MN","MO","MS","MT",
"NC","ND","NE","NH","NJ","NM","NN","NV","NY","OH",
"OK","OR","PA","PR","RI","SC","SD","TN","TT","TX",
"UT","VA","VI","VT","WA","WI","WV","WY",
};
private BitSet statesVisited = new BitSet( possibleStates.length );
...
statesVisited.set( 4 );
boolean beenToCalifornia = statsVisited.get( 5 );
statesVisited.clear( 38 );
statesVisited.flip( 59 );