Class that implements a queue using two stacks
Unfortunately your code does not implement a queue. It is relatively easy to produce circumstances which break the logic. Consider the following, for example:

MyQueue&lt;String&gt; q = new MyQueue&lt;&gt;();

q.add("a");
q.add("b");
q.remove(); // should be "a", and is "a".
q.add("c");
q.remove(); // should be "b", but is "c".
q.remove(); // should be "c", but is "b".


Using two stacks to implement a queue is not a logical data structure as far as I am concerned. There are many better ways.