AbstractBalancer implements Balancer<Z, D> { @Override public int size() { return this.getDatabases().size(); }  @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 size() { Balancer<Void, MockDatabase> balancer = this.factory.createBalancer(Collections.<MockDatabase>emptySet()); assertEquals(0, balancer.size()); balancer = this.factory.createBalancer(Collections.singleton(this.databases[0])); assertEquals(1, balancer.size()); balancer = this.factory.createBalancer(new HashSet<>(Arrays.asList(this.databases[0], this.databases[1]))); assertEquals(2, balancer.size()); balancer = this.factory.createBalancer(new HashSet<>(Arrays.asList(this.databases))); assertEquals(3, balancer.size()); }