### Question:
QuotaServer { public double getRate(T operation) { checkArgument(quotaMap.containsKey(operation), "undefined operation"); return quotaMap.get(operation).getRate(); } private  QuotaServer(Builder<T, ? extends QuotaServer<T>> builder); double acquire(T operation); double getRate(T operation); static QuotaServer<T> createFromConfiguration(
      String quotaPrefix, Class<T> enumClass); static final double DEFAULT_QPS; }### Answer:
@Test public void testDefaultBuilder() { QuotaServer<Operations> qs = new QuotaServer.Builder<>(Operations.class).build(); assertEquals(QuotaServer.DEFAULT_QPS, qs.getRate(Operations.OP1), DELTA_FOR_EQUALS); assertEquals(QuotaServer.DEFAULT_QPS, qs.getRate(Operations.OP2), DELTA_FOR_EQUALS); assertEquals(QuotaServer.DEFAULT_QPS, qs.getRate(Operations.OP3), DELTA_FOR_EQUALS); }
@Test public void testNonDefaultQpsBuilder() { QuotaServer<Operations> qs = new QuotaServer.Builder<>(Operations.class).setDefaultQps(4).build(); assertEquals(4, qs.getRate(Operations.OP1), DELTA_FOR_EQUALS); assertEquals(4, qs.getRate(Operations.OP2), DELTA_FOR_EQUALS); assertEquals(4, qs.getRate(Operations.OP3), DELTA_FOR_EQUALS); }
@Test public void testOverrideDefaultQpsBuilder() { QuotaServer<Operations> qs = new QuotaServer.Builder<>(Operations.class) .addQuota(Operations.OP3, 8) .setDefaultQps(4) .build(); assertEquals(4, qs.getRate(Operations.OP1), DELTA_FOR_EQUALS); assertEquals(4, qs.getRate(Operations.OP2), DELTA_FOR_EQUALS); assertEquals(8, qs.getRate(Operations.OP3), DELTA_FOR_EQUALS); }