How do you write this method?

Answer:
when threshold is reached, then hashset is resized, and new capacity of the hashset is double the previous capacity.
We need to create a MyHashTable object and use below code inside the method: MyHashTable g1=new MyHashTable(newsize, 0.75);
if(g1.LoadFactorLimit>=1)
{
Boolean a=g1.add (new LinkedList<string> ());
If(a)
{
System.out.println(“string inserted and list resized”);
}
Else
{
System.out.println(“string already present”);
}
}
Explanation:
Please check the answer section.