This week's book giveaways are in the iOS and Features new in Java 8 forums. We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line! See this thread and this one for details.
I know that this is a snippet, so this may be off-base... However, if this is not a snippet, then the error makes sense. Java code can't be anywhere -- they have to be in methods, constructors, or initializers, which the call to the count() method isn't.