diff --git a/src/test/resources/inferWildcards/TestClassWildcards.java b/src/test/resources/inferWildcards/TestClassWildcards.java index cb597cf6..61f16c9c 100644 --- a/src/test/resources/inferWildcards/TestClassWildcards.java +++ b/src/test/resources/inferWildcards/TestClassWildcards.java @@ -1,20 +1,38 @@ import java.util.ArrayList; -class TestClassWildcards { +class TestClassWildcards +{ - private List field1; + private List field1; private int counter; - public TestClassWildcards(){ - field1 = new ArrayList<>(); + public TestClassWildcards () { + field1 = new ArrayList<>(); counter = 0; - } + } - public List test(List param1){ - List localVar = field1; - field1 = param; + /** + * Working method for Java + * @param param1 + * @return + */ + public List test (List param1) { + List localVar = field1; + field1 = param; counter++; - return localVar; - } + return localVar; + } + /** + * Non working method in normal Java + * @param input + * @return + */ + public List test2 (List input) { + List listOfObjects = input; + Object test = listOfObjects.get(0); + String string = "Test"; + input.add(string); + return listOfObjects; + } } \ No newline at end of file