Here you can find the source of emptyToDefault(T[] values, T[] def)
public static <T> T[] emptyToDefault(T[] values, T[] def)
//package com.java2s; //License from project: Apache License public class Main { public static <T> T[] emptyToDefault(T[] values, T[] def) { return values == null || values.length == 0 ? def : values; }/*from w w w. j a va 2s .c o m*/ public static byte[] emptyToDefault(byte[] values, byte[] def) { return values == null || values.length == 0 ? def : values; } public static short[] emptyToDefault(short[] values, short[] def) { return values == null || values.length == 0 ? def : values; } public static int[] emptyToDefault(int[] values, int[] def) { return values == null || values.length == 0 ? def : values; } public static long[] emptyToDefault(long[] values, long[] def) { return values == null || values.length == 0 ? def : values; } public static float[] emptyToDefault(float[] values, float[] def) { return values == null || values.length == 0 ? def : values; } public static double[] emptyToDefault(double[] values, double[] def) { return values == null || values.length == 0 ? def : values; } }