class Test {
    public static void main(String[] args) {
        java.util.function.Function<Integer[], String> f = a -> {
            String s = "";
            for (int i = a.length, j = i; i-- > 0;)
                s += "%" + j + "s";
            return s.format(s, a);
        };
    
        System.out.println(f.apply(new Integer[] {0}));
        System.out.println(f.apply(new Integer[] {2, 10}));
        System.out.println(f.apply(new Integer[] {7, 8, 9, 10}));
        System.out.println(f.apply(new Integer[] {1, 33, 333, 7777}));
        System.out.println(f.apply(new Integer[] {0, 0, 0, 0, 0, 0}));
    }
}