import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSet.Builder;
import com.google.common.primitives.UnsignedInteger;
+import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
<T> T[] expand(final OffsetMap oldOffsets, final T[] oldArray, final int offset) {
@SuppressWarnings("unchecked")
- final T[] ret = (T[]) new Object[this.routerIds.length];
+ final T[] ret = (T[]) Array.newInstance(oldArray.getClass().getComponentType(), this.routerIds.length);
final int oldSize = oldOffsets.routerIds.length;
System.arraycopy(oldArray, 0, ret, 0, offset);