You can compare arrays with the Arrays class. But be sure to read the javadoc because the methods in it have some curiosities. For instance that Arrays.equals(Object a, Objectb) compares using == and not the equals method.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.