Here you can find the source of maxLengthSurface(ArrayList
private static String maxLengthSurface(ArrayList<String> value)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; public class Main { private static String maxLengthSurface(ArrayList<String> value) { String maxSurface = value.get(0); int maxSurfaceLength = value.get(0).length(); for (String compound : value) { if (compound.length() > maxSurfaceLength) { maxSurface = compound;//from w w w. j a va 2s . co m maxSurfaceLength = compound.length(); } } return maxSurface; } }