// Path: src/main/java/org/fest/util/Arrays.java
// public static boolean isArray(@Nullable Object o) {
//   return o != null && o.getClass().isArray();
// }
// 
// Path: src/main/java/org/fest/util/Preconditions.java
// public static @NotNull <T> T checkNotNull(@Nullable T reference) {
//   if (reference == null) {
//     throw new NullPointerException();
//   }
//   return reference;
// }


import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.lang.reflect.Array;
import static org.fest.util.Arrays.isArray;
import static org.fest.util.Preconditions.checkNotNull;
/*
 * Created on Jun 2, 2006
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *
 * Copyright @2006-2013 the original author or authors.
 */
package org.fest.util;



/**
 * Utility methods related to objects.
 *
 * @author Alex Ruiz
 * @author Joel Costigliola
 */
public final class Objects {
  /**
   * Prime number used to calculate the hash code of objects.
   */
  public static final int HASH_CODE_PRIME = 31;

  private Objects() {
  }

  /**
   * Indicates whether the given objects are equal.
   *
   * @param o1 one of the objects to compare.
   * @param o2 one of the objects to compare.
   * @return {@code true} if the given objects are equal or if both objects are {@code null}.
   */
  public static boolean areEqual(@Nullable Object o1, @Nullable Object o2) {
    if (o1 == null) {
      return o2 == null;
    }
    if (o1.equals(o2)) {
      return true;
    }
    return areEqualArrays(o1, o2);
  }

  private static boolean areEqualArrays(@Nullable Object o1, @Nullable Object o2) {
// Path: src/main/java/org/fest/util/Arrays.java
// public static boolean isArray(@Nullable Object o) {
//   return o != null && o.getClass().isArray();
// }
// 
// Path: src/main/java/org/fest/util/Preconditions.java
// public static @NotNull <T> T checkNotNull(@Nullable T reference) {
//   if (reference == null) {
//     throw new NullPointerException();
//   }
//   return reference;
// }


// Path: src/main/java/org/fest/util/Objects.java
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.lang.reflect.Array;
import static org.fest.util.Arrays.isArray;
import static org.fest.util.Preconditions.checkNotNull;

/*
 * Created on Jun 2, 2006
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *
 * Copyright @2006-2013 the original author or authors.
 */
package org.fest.util;



/**
 * Utility methods related to objects.
 *
 * @author Alex Ruiz
 * @author Joel Costigliola
 */
public final class Objects {
  /**
   * Prime number used to calculate the hash code of objects.
   */
  public static final int HASH_CODE_PRIME = 31;

  private Objects() {
  }

  /**
   * Indicates whether the given objects are equal.
   *
   * @param o1 one of the objects to compare.
   * @param o2 one of the objects to compare.
   * @return {@code true} if the given objects are equal or if both objects are {@code null}.
   */
  public static boolean areEqual(@Nullable Object o1, @Nullable Object o2) {
    if (o1 == null) {
      return o2 == null;
    }
    if (o1.equals(o2)) {
      return true;
    }
    return areEqualArrays(o1, o2);
  }

  private static boolean areEqualArrays(@Nullable Object o1, @Nullable Object o2) {
    if (!isArray(o1) || !isArray(o2)) {