Java tutorial
//package com.java2s; import java.util.Arrays; import java.util.List; public class Main { public static String[] getStringsFormat(List<String> mapValuesList) { final String[] arr = new String[mapValuesList.size()]; mapValuesList.toArray(arr); Arrays.sort(arr); return arr; } }