Code example for Set

Methods: add

0
     
    private static final Set<String> stringSet;
     
    static { 
    	stringSet = new HashSet<String>();
    	stringSet.add( "string1" );
    	stringSet.add( "string2" );
    	stringSet.add( "string3" );
    } 
     
    @Before 
    public void setUp() { 
        content = new HashMap<String, Map<String, Object>>();
 
        sharedPreferences = new TestSharedPreferences(content, FILENAME, 3);
        editor = sharedPreferences.edit();
        editor.putBoolean("boolean", true);
        editor.putFloat("float", 1.1f);
        editor.putInt("int", 2);
        editor.putLong("long", 3l);
        editor.putString("string", "foobar");