Using LRStruct to pass a test

1. Define this method so that it adds the Strings in inputto an initially empty LRStruct<String> so that they appearin the same order. Example: if input contains "a", "b" and "c", in that order, the returned list must contain "a", "b" and "c", in that order.

LRStruct Class: http://www.cs.rice.edu/~mgricken/re...ce_MBS/RiceMBS.student/docs/lrs/LRStruct.html

Test:
Code:
@Test
public void testABC() {
String expected = "(a b c)";
String actual = answer.toString();
assertTrue("I thought answer would be "+expected+" but it was "+actual, expected.equals(actual));
}

2. Here's my attempt at the method addInOrder. All I'm getting is the string c to add to the LRStruct. Not sure why my if statement isn't working correctly.

Code:
public LRStruct<String> addInOrder(List<String> input) {

LRStruct<String> lrstruct = new LRStruct<String>();
int counter = 2;

if(counter>=0){
lrstruct.insertFront(input.get(counter));
counter--;
}

return lrstruct;
}

I think what you're looking for is a loop. I.e.:
Code:
int counter = 2;

if(counter>=0){
lrstruct.insertFront(input.get(counter));
counter--;
}
will do the exact same thing as
Code:
lrstruct.insertFront(input.get(2));

Okay I understand that but thats the exact same thing I wrote. That's not helping me.

You need a loop

Doesn't Java have while loops, or for loops? Or for-each loops?