AbstractBalancer implements Balancer<Z, D> { @Override public Object[] toArray() { return this.getDatabases().toArray(); }  @Override Iterable<D> backups(); @Override Iterator<D> iterator(); @Override boolean contains(Object database); @Override boolean containsAll(Collection<?> databases); @Override boolean isEmpty(); @Override int size(); @Override Object[] toArray(); @Override T[] toArray(T[] array); @Override boolean equals(Object object); @Override int hashCode(); @Override String toString();  }
@Test public void toArray() { Balancer<Void, MockDatabase> balancer = this.factory.createBalancer(Collections.<MockDatabase>emptySet()); assertTrue(Arrays.equals(new Object[0], balancer.toArray())); balancer = this.factory.createBalancer(Collections.singleton(this.databases[0])); assertTrue(Arrays.equals(new Object[] { this.databases[0] }, balancer.toArray())); balancer = this.factory.createBalancer(new HashSet<>(Arrays.asList(this.databases[0], this.databases[1]))); assertTrue(Arrays.equals(new Object[] { this.databases[0], this.databases[1] }, balancer.toArray())); balancer = this.factory.createBalancer(new HashSet<>(Arrays.asList(this.databases))); assertTrue(Arrays.equals(this.databases, balancer.toArray())); }