Java tutorial
//package com.java2s; import java.util.List; public class Main { public static String joinSelectionCriteria(List<String> input) { if (input.size() == 0) { return null; } StringBuffer sb = new StringBuffer(); for (int i = 0; i < input.size(); i++) { if (i > 0) { sb.append(" AND "); } sb.append(input.get(i)); } return sb.toString(); } }