Here you can find the source of toPlural(String name)
public static String toPlural(String name)
//package com.java2s; //License from project: Apache License public class Main { public static String toPlural(String name) { if (name.endsWith("y")) { int length = name.length(); name = name.substring(0, length - 2); return name + "ies"; }//from w w w . j a va2 s .c om if (name.endsWith("s")) return name + "es"; if (name.equalsIgnoreCase("child")) return name + "ren"; return name + "s"; } }