One possibility that I can think of is to store the score in a member variable of the class. This, of course, assumes that the public doIt method is called by only one thread.
Another option is to reorganize the public method to invoke the private helper method. The private method takes a list as a parameter and returns a counter. For instance:
public List<Thing> doIt(String aString) { List<Thing> list = new ArrayList<Thing>(); int count = doItHelper(aString, list, 0);
It is assumed that you can perform error handling in the public doIt method, since the count variable does not actually return back to the caller. If you need to do this, you can, of course, throw an exception:
public List<Thing> doIt(String aString) throws SomeCustomException { List<Thing> list = new ArrayList<Thing>(); int count = doItHelper(aString, list, 0);
It's hard to see if this will help without knowing more about how your algorithm works.
source share