Here you can find the source of pluralize(String base, int quantity)
public static String pluralize(String base, int quantity)
//package com.java2s; public class Main { public static String pluralize(String base, int quantity) { if (quantity == 1) return base; else if (base.trim().toLowerCase().endsWith("s")) return base + "es"; else/*w ww. j a va 2s . c o m*/ return base + "s"; } }