JCEnhancedForLoop enhancedForLoop = (JCEnhancedForLoop) tree;
IdentifierTree identifier =
getIncrementedIdentifer(extractSingleStatement(enhancedForLoop.body));
if (identifier != null) {
ExpressionTree expression = tree.getExpression();
Fix fix;
if (isSubtypeOf("java.util.Collection").matches(expression, state)) {
String replacement = identifier + " += " + expression + ".size();";
fix = SuggestedFix.replace(tree, replacement);
} else if (isArrayType().matches(expression, state)) {
String replacement = identifier + " += " + expression + ".length;";