//HashSetAddRemoveResult.java

import java.util.HashSet;

public class HashSetAddRemoveResult
{
    public static void main(String[] args)
    {
        HashSet<String> ownedBooks = new HashSet<String>();
        boolean addResult;
        boolean removeResult;

        ownedBooks.add("A Tale of Two Cities");
        ownedBooks.add("The Lord of the Rings");
        ownedBooks.add("Le Petit Prince");

        addResult = ownedBooks.add("Le Petit Prince");
        System.out.println("Added \"Le Petit Prince\" again: " + addResult);

        removeResult = ownedBooks.remove("The Hobbit");
        System.out.println("Removed \"The Hobbit\": " + removeResult);
    }
}

