[java] How to create a sub array from another array in Java?