aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject [3/3] aurora git commit: Convert test sources to use lambdas throughout.
Date Thu, 10 Dec 2015 18:11:45 GMT
Convert test sources to use lambdas throughout.

Reviewed at https://reviews.apache.org/r/41181/


Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/d5d5a73c
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/d5d5a73c
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/d5d5a73c

Branch: refs/heads/master
Commit: d5d5a73c484bb626ce360e006631e1b08eadc6b0
Parents: 8613f7b
Author: Bill Farner <wfarner@apache.org>
Authored: Thu Dec 10 10:11:35 2015 -0800
Committer: Bill Farner <wfarner@apache.org>
Committed: Thu Dec 10 10:11:35 2015 -0800

----------------------------------------------------------------------
 .../aurora/common/args/ArgFiltersTest.java      |   6 +-
 .../aurora/common/args/ArgScannerTest.java      | 238 +++++------------
 .../common/collections/Iterables2Test.java      |   6 +-
 .../http/handlers/TimeSeriesDataSourceTest.java |   6 +-
 .../testing/easymock/EasyMockTestTest.java      |   8 +-
 .../templating/StringTemplateHelperTest.java    |  24 +-
 .../aurora/common/zookeeper/GroupTest.java      |  12 +-
 .../common/zookeeper/ServerSetImplTest.java     |  27 +-
 .../common/zookeeper/SingletonServiceTest.java  |   6 +-
 .../common/zookeeper/ZooKeeperClientTest.java   |  42 ++-
 .../aurora/benchmark/SchedulingBenchmarks.java  |  26 +-
 .../aurora/benchmark/StatusUpdateBenchmark.java |  46 +---
 .../aurora/benchmark/ThriftApiBenchmarks.java   |  55 ++--
 .../aurora/benchmark/UpdateStoreBenchmarks.java |  58 ++---
 .../benchmark/fakes/FakeStatsProvider.java      |   7 +-
 .../aurora/scheduler/TaskStatusHandlerImpl.java |   2 +-
 .../scheduler/cron/quartz/AuroraCronJob.java    |   2 +-
 .../cron/quartz/CronJobManagerImpl.java         |   4 +-
 .../scheduler/mesos/MesosSchedulerImpl.java     |  23 +-
 .../pruning/JobUpdateHistoryPruner.java         |   3 +-
 .../scheduler/scheduling/TaskThrottler.java     |  17 +-
 .../storage/CallOrderEnforcingStorage.java      |   2 +-
 .../scheduler/storage/backup/Recovery.java      |   3 +-
 .../storage/backup/TemporaryStorage.java        |   3 +-
 .../storage/db/RowGarbageCollector.java         |   2 +-
 .../scheduler/storage/log/LogStorage.java       |   9 +-
 .../storage/log/SnapshotStoreImpl.java          |   2 +-
 .../updater/JobUpdateControllerImpl.java        |  13 +-
 .../aurora/scheduler/ResourceSlotTest.java      |   8 +-
 .../apache/aurora/scheduler/ResourcesTest.java  |   1 -
 .../scheduler/TaskStatusHandlerImplTest.java    |  26 +-
 .../apache/aurora/scheduler/TaskVarsTest.java   |  16 +-
 .../aurora/scheduler/app/SchedulerIT.java       | 117 +++------
 .../aurora/scheduler/app/local/FakeMaster.java  |  44 ++--
 .../app/local/simulator/FakeSlaves.java         |  22 +-
 .../async/GatingDelayExecutorTest.java          |  63 ++---
 .../aurora/scheduler/base/AsyncUtilTest.java    |  27 +-
 .../apache/aurora/scheduler/base/JobsTest.java  |   9 +-
 .../cron/quartz/AuroraCronJobTest.java          |  31 +--
 .../aurora/scheduler/cron/quartz/CronIT.java    |  32 +--
 .../cron/quartz/CronJobManagerImplTest.java     |  18 +-
 .../cron/quartz/CronPredictorImplTest.java      |   8 +-
 .../scheduler/http/JettyServerModuleTest.java   |   8 +-
 .../scheduler/http/LeaderRedirectTest.java      |  11 +-
 .../scheduler/http/RequestLoggerTest.java       |   1 -
 .../scheduler/log/mesos/MesosLogTest.java       |  16 +-
 .../apache/aurora/scheduler/mesos/Offers.java   |   1 -
 .../offers/RandomJitterReturnDelayTest.java     |   1 -
 .../preemptor/PreemptionVictimFilterTest.java   |  16 +-
 .../pruning/TaskHistoryPrunerTest.java          |  48 ++--
 .../reconciliation/TaskReconcilerTest.java      |   1 -
 .../RescheduleCalculatorImplTest.java           |   8 +-
 .../scheduler/scheduling/TaskGroupsTest.java    |  18 +-
 .../scheduling/TaskSchedulerImplTest.java       |  19 +-
 .../aurora/scheduler/sla/SlaModuleTest.java     |  11 +-
 .../scheduler/state/LockManagerImplTest.java    |  31 +--
 .../scheduler/state/StateManagerImplTest.java   | 103 +++-----
 .../scheduler/state/TaskStateMachineTest.java   |   7 +-
 .../scheduler/stats/ResourceCounterTest.java    |  22 +-
 .../storage/AbstractCronJobStoreTest.java       |  75 ++----
 .../storage/AbstractTaskStoreTest.java          | 168 ++++--------
 .../scheduler/storage/StorageBackfillTest.java  |  17 +-
 .../storage/db/DbAttributeStoreTest.java        |  47 +---
 .../storage/db/DbJobUpdateStoreTest.java        | 255 +++++++------------
 .../scheduler/storage/db/DbLockStoreTest.java   |  58 ++---
 .../scheduler/storage/db/DbQuotaStoreTest.java  |  48 +---
 .../storage/db/DbSchedulerStoreTest.java        |  22 +-
 .../scheduler/storage/db/DbStorageTest.java     |  26 +-
 .../scheduler/storage/log/LogManagerTest.java   |  27 +-
 .../scheduler/storage/log/LogStorageTest.java   | 189 ++++++--------
 .../storage/mem/InMemTaskStoreTest.java         |  16 +-
 .../storage/mem/StorageTransactionTest.java     | 174 +++++--------
 .../storage/testing/StorageTestUtil.java        |  20 +-
 .../testing/FakeScheduledExecutor.java          |  78 +++---
 .../aurora/scheduler/thrift/Fixtures.java       |   7 +-
 .../thrift/SchedulerThriftInterfaceTest.java    |  29 +--
 .../thrift/aop/AnnotatedAuroraAdminTest.java    |  18 +-
 .../aurora/scheduler/updater/AddTaskTest.java   |   1 -
 .../aurora/scheduler/updater/JobUpdaterIT.java  | 173 +++++--------
 79 files changed, 909 insertions(+), 1935 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/commons/src/test/java/org/apache/aurora/common/args/ArgFiltersTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/args/ArgFiltersTest.java b/commons/src/test/java/org/apache/aurora/common/args/ArgFiltersTest.java
index b312bae..0390809 100644
--- a/commons/src/test/java/org/apache/aurora/common/args/ArgFiltersTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/args/ArgFiltersTest.java
@@ -89,11 +89,7 @@ public class ArgFiltersTest {
   private void testFilter(final Predicate<Field> filter, Configuration.ArgInfo... expected)
       throws IOException {
 
-    Predicate<Optional<Field>> fieldFilter = new Predicate<Optional<Field>>() {
-      @Override public boolean apply(Optional<Field> maybeField) {
-        return maybeField.isPresent() && filter.apply(maybeField.get());
-      }
-    };
+    Predicate<Optional<Field>> fieldFilter = maybeField -> maybeField.isPresent() && filter.apply(maybeField.get());
 
     assertEquals(ImmutableSet.copyOf(expected),
         ImmutableSet.copyOf(Iterables.filter(Configuration.load().optionInfo(),

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/commons/src/test/java/org/apache/aurora/common/args/ArgScannerTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/args/ArgScannerTest.java b/commons/src/test/java/org/apache/aurora/common/args/ArgScannerTest.java
index de04304..48afb61 100644
--- a/commons/src/test/java/org/apache/aurora/common/args/ArgScannerTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/args/ArgScannerTest.java
@@ -73,13 +73,9 @@ import static org.junit.Assert.fail;
 public class ArgScannerTest {
 
   private static final Function<Class<?>, Predicate<Field>> TO_SCOPE_PREDICATE =
-      new Function<Class<?>, Predicate<Field>>() {
-        @Override public Predicate<Field> apply(final Class<?> cls) {
-          return new Predicate<Field>() {
-            @Override public boolean apply(Field field) {
-              return field.getDeclaringClass() == cls;
-            }
-          };
+      cls -> new Predicate<Field>() {
+        @Override public boolean apply(Field field) {
+          return field.getDeclaringClass() == cls;
         }
       };
 
@@ -130,104 +126,54 @@ public class ArgScannerTest {
   @Test
   public void testStandardArgs() {
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(StandardArgs.ENUM_VAL.get(), CoreMatchers.is(Optimizations.ALL));
-          }
-        }, "enum", "ALL");
+        () -> assertThat(StandardArgs.ENUM_VAL.get(), CoreMatchers.is(Optimizations.ALL)), "enum", "ALL");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(StandardArgs.STRING_VAL.get(), is("newstring"));
-          }
-        },
+        () -> assertThat(StandardArgs.STRING_VAL.get(), is("newstring")),
         "string", "newstring");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() { assertThat(StandardArgs.CHAR_VAL.get(), is('x')); }
-        },
+        () -> assertThat(StandardArgs.CHAR_VAL.get(), is('x')),
         "char", "x");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(StandardArgs.BYTE_VAL.get(), is((byte) 10));
-          }
-        },
+        () -> assertThat(StandardArgs.BYTE_VAL.get(), is((byte) 10)),
         "byte", "10");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(StandardArgs.SHORT_VAL.get(), is((short) 10));
-          }
-        },
+        () -> assertThat(StandardArgs.SHORT_VAL.get(), is((short) 10)),
         "short", "10");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() { assertThat(StandardArgs.INT_VAL.get(), is(10)); }
-        },
+        () -> assertThat(StandardArgs.INT_VAL.get(), is(10)),
         "int", "10");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() { assertThat(StandardArgs.LONG_VAL.get(), is(10L)); }
-        },
+        () -> assertThat(StandardArgs.LONG_VAL.get(), is(10L)),
         "long", "10");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() { assertThat(StandardArgs.FLOAT_VAL.get(), is(10f)); }
-        },
+        () -> assertThat(StandardArgs.FLOAT_VAL.get(), is(10f)),
         "float", "10.0");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() { assertThat(StandardArgs.DOUBLE_VAL.get(), is(10d)); }
-        },
+        () -> assertThat(StandardArgs.DOUBLE_VAL.get(), is(10d)),
         "double", "10.0");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() { assertThat(StandardArgs.BOOL.get(), is(true)); }
-        },
+        () -> assertThat(StandardArgs.BOOL.get(), is(true)),
         "bool", "true");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() { assertThat(StandardArgs.BOOL.get(), is(true)); }
-        },
+        () -> assertThat(StandardArgs.BOOL.get(), is(true)),
         "bool", "");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(StandardArgs.REGEX.get().matcher("jack").matches(), is(true));
-          }
-        },
+        () -> assertThat(StandardArgs.REGEX.get().matcher("jack").matches(), is(true)),
         "regex", ".*ack$");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() { assertThat(StandardArgs.BOOL.get(), is(false)); }
-        },
+        () -> assertThat(StandardArgs.BOOL.get(), is(false)),
         "no_bool", "");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() { assertThat(StandardArgs.BOOL.get(), is(true)); }
-        },
+        () -> assertThat(StandardArgs.BOOL.get(), is(true)),
         "no_bool", "false");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(StandardArgs.TIME_AMOUNT.get(), is(Amount.of(100L, Time.SECONDS)));
-          }
-        },
+        () -> assertThat(StandardArgs.TIME_AMOUNT.get(), is(Amount.of(100L, Time.SECONDS))),
         "time_amount", "100secs");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(StandardArgs.DATA_AMOUNT.get(), is(Amount.of(1L, Data.Gb)));
-          }
-        },
+        () -> assertThat(StandardArgs.DATA_AMOUNT.get(), is(Amount.of(1L, Data.Gb))),
         "data_amount", "1Gb");
     test(StandardArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(StandardArgs.RANGE.get(), is(com.google.common.collect.Range.closed(1, 5)));
-          }
-        },
+        () -> assertThat(StandardArgs.RANGE.get(), is(com.google.common.collect.Range.closed(1, 5))),
         "range", "1-5");
 
     resetArgs(StandardArgs.class);
@@ -301,17 +247,9 @@ public class ArgScannerTest {
   @Test
   public void testCustomArgs() {
     test(CustomArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(CustomArgs.NAME_VAL.get(), is(new Name("jane")));
-          }
-        }, "custom1", "jane");
+        () -> assertThat(CustomArgs.NAME_VAL.get(), is(new Name("jane"))), "custom1", "jane");
     test(CustomArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(CustomArgs.MEANING_VAL.get(), is(new MeaningOfLife(42L)));
-          }
-        }, "custom2", "jim");
+        () -> assertThat(CustomArgs.MEANING_VAL.get(), is(new MeaningOfLife(42L))), "custom2", "jim");
   }
 
   @Test
@@ -364,95 +302,59 @@ public class ArgScannerTest {
   @Test
   public void testCollectionArgs() {
     test(CollectionArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(CollectionArgs.STRING_LIST.get(), is(Arrays.asList("a", "b", "c", "d")));
-          }
-        },
+        () -> assertThat(CollectionArgs.STRING_LIST.get(), is(Arrays.asList("a", "b", "c", "d"))),
         "stringList", "a,b,c,d");
     test(CollectionArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(CollectionArgs.INT_LIST.get(), is(Arrays.asList(1, 2, 3, 4)));
-          }
-        },
+        () -> assertThat(CollectionArgs.INT_LIST.get(), is(Arrays.asList(1, 2, 3, 4))),
         "intList", "1, 2, 3, 4");
     test(CollectionArgs.class,
-        new Command() {
-          @Override public void execute() {
-            Set<String> expected = ImmutableSet.of("a", "b", "c", "d");
-            assertThat(CollectionArgs.STRING_SET.get(), is(expected));
-          }
+        () -> {
+          Set<String> expected = ImmutableSet.of("a", "b", "c", "d");
+          assertThat(CollectionArgs.STRING_SET.get(), is(expected));
         },
         "stringSet", "a,b,c,d");
     test(CollectionArgs.class,
-        new Command() {
-          @Override public void execute() {
-            Set<Integer> expected = ImmutableSet.of(1, 2, 3, 4);
-            assertThat(CollectionArgs.INT_SET.get(), is(expected));
-          }
+        () -> {
+          Set<Integer> expected = ImmutableSet.of(1, 2, 3, 4);
+          assertThat(CollectionArgs.INT_SET.get(), is(expected));
         },
         "intSet", "1, 2, 3, 4");
     test(CollectionArgs.class,
-        new Command() {
-          @Override public void execute() {
-            Map<String, String> expected = ImmutableMap.of("a", "b", "c", "d", "e", "f", "g", "h");
-            assertThat(CollectionArgs.STRING_STRING_MAP.get(), is(expected));
-          }
+        () -> {
+          Map<String, String> expected = ImmutableMap.of("a", "b", "c", "d", "e", "f", "g", "h");
+          assertThat(CollectionArgs.STRING_STRING_MAP.get(), is(expected));
         },
         "stringStringMap", "a=b, c=d, e=f, g=h");
     test(CollectionArgs.class,
-        new Command() {
-          @Override public void execute() {
-            Map<Integer, Integer> expected = ImmutableMap.of(1, 2, 3, 4, 5, 6, 7, 8);
-            assertThat(CollectionArgs.INT_INT_MAP.get(), is(expected));
-          }
+        () -> {
+          Map<Integer, Integer> expected = ImmutableMap.of(1, 2, 3, 4, 5, 6, 7, 8);
+          assertThat(CollectionArgs.INT_INT_MAP.get(), is(expected));
         },
         "intIntMap", "1 = 2,3=4, 5=6 ,7=8");
     test(CollectionArgs.class,
-        new Command() {
-          @Override public void execute() {
-            Map<String, Integer> expected = ImmutableMap.of("a", 1, "b", 2, "c", 3, "d", 4);
-            assertThat(CollectionArgs.STRING_INT_MAP.get(), is(expected));
-          }
+        () -> {
+          Map<String, Integer> expected = ImmutableMap.of("a", 1, "b", 2, "c", 3, "d", 4);
+          assertThat(CollectionArgs.STRING_INT_MAP.get(), is(expected));
         },
         "stringIntMap", "a=1  , b=2, c=3   ,d=4");
     test(CollectionArgs.class,
-        new Command() {
-          @Override public void execute() {
-            Map<Integer, String> expected = ImmutableMap.of(1, "1", 2, "2", 3, "3", 4, "4");
-            assertThat(CollectionArgs.INT_STRING_MAP.get(), is(expected));
-          }
+        () -> {
+          Map<Integer, String> expected = ImmutableMap.of(1, "1", 2, "2", 3, "3", 4, "4");
+          assertThat(CollectionArgs.INT_STRING_MAP.get(), is(expected));
         },
         "intStringMap", "  1=1  , 2=2, 3=3,4=4");
     test(CollectionArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(CollectionArgs.STRING_STRING_PAIR.get(), is(Pair.of("foo", "bar")));
-          }
-        },
+        () -> assertThat(CollectionArgs.STRING_STRING_PAIR.get(), is(Pair.of("foo", "bar"))),
         "stringStringPair", "foo , bar");
     test(CollectionArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(CollectionArgs.INT_INT_PAIR.get(), is(Pair.of(10, 20)));
-          }
-        },
+        () -> assertThat(CollectionArgs.INT_INT_PAIR.get(), is(Pair.of(10, 20))),
         "intIntPair", "10    ,20");
     test(CollectionArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(CollectionArgs.STRING_TIME_AMOUNT_PAIR.get(),
-                       is(Pair.of("fred", Amount.of(42L, Time.MINUTES))));
-          }
-        },
+        () -> assertThat(CollectionArgs.STRING_TIME_AMOUNT_PAIR.get(),
+                   is(Pair.of("fred", Amount.of(42L, Time.MINUTES)))),
         "stringTimeAmountPair", "fred    ,42mins");
     test(CollectionArgs.class,
-        new Command() {
-          @Override public void execute() {
-            CollectionArgs.STRING_TIME_AMOUNT_PAIR.get();
-          }
-        },
+        CollectionArgs.STRING_TIME_AMOUNT_PAIR::get,
         true, "stringTimeAmountPair", "george,1MB");
 
   }
@@ -473,44 +375,24 @@ public class ArgScannerTest {
   @Test
   public void testWildcardArgs() {
     test(WildcardArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertSame(Serializable2.class, WildcardArgs.CLAZZ.get());
-          }
-        },
+        () -> assertSame(Serializable2.class, WildcardArgs.CLAZZ.get()),
         "class", Serializable2.class.getName());
 
     test(WildcardArgs.class,
-        new Command() {
-          @Override public void execute() {
-            WildcardArgs.CLAZZ.get();
-          }
-        },
+        WildcardArgs.CLAZZ::get,
         true, "class", Runnable.class.getName());
 
     test(WildcardArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertEquals(ImmutableList.of(Serializable1.class, Serializable2.class),
-                         WildcardArgs.CLASS_LIST_1.get());
-          }
-        },
+        () -> assertEquals(ImmutableList.of(Serializable1.class, Serializable2.class),
+                     WildcardArgs.CLASS_LIST_1.get()),
         "classList1", Serializable1.class.getName() + "," + Serializable2.class.getName());
 
     test(WildcardArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertEquals(ImmutableList.of(Serializable2.class), WildcardArgs.CLASS_LIST_2.get());
-          }
-        },
+        () -> assertEquals(ImmutableList.of(Serializable2.class), WildcardArgs.CLASS_LIST_2.get()),
         "classList2", Serializable2.class.getName());
 
     test(WildcardArgs.class,
-        new Command() {
-          @Override public void execute() {
-            WildcardArgs.CLASS_LIST_2.get();
-          }
-        },
+        WildcardArgs.CLASS_LIST_2::get,
         true, "classList2", Serializable1.class.getName() + "," + Runnable.class.getName());
   }
 
@@ -563,11 +445,9 @@ public class ArgScannerTest {
   @Test
   public void testEnforcesConstraints() {
     test(VerifyArgs.class,
-        new Command() {
-          @Override public void execute() {
-            assertThat(VerifyArgs.STRING_VAL.get(), is("newstring"));
-            assertThat(VerifyArgs.OPTIONAL_STRING_VAL.get(), nullValue(String.class));
-          }
+        () -> {
+          assertThat(VerifyArgs.STRING_VAL.get(), is("newstring"));
+          assertThat(VerifyArgs.OPTIONAL_STRING_VAL.get(), nullValue(String.class));
         },
         "string", "newstring");
 
@@ -578,11 +458,7 @@ public class ArgScannerTest {
     testFails(VerifyArgs.class, "long", "-1");
 
     test(VerifyArgs.class,
-        new Command() {
-          @Override public void execute() {
-           assertThat(VerifyArgs.FLOAT_VAL.get(), is(10.5f));
-          }
-        },
+        () -> assertThat(VerifyArgs.FLOAT_VAL.get(), is(10.5f)),
         "float", "10.5");
     testFails(VerifyArgs.class, "float", "9");
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/commons/src/test/java/org/apache/aurora/common/collections/Iterables2Test.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/collections/Iterables2Test.java b/commons/src/test/java/org/apache/aurora/common/collections/Iterables2Test.java
index 5b832cd..11ff376 100644
--- a/commons/src/test/java/org/apache/aurora/common/collections/Iterables2Test.java
+++ b/commons/src/test/java/org/apache/aurora/common/collections/Iterables2Test.java
@@ -72,11 +72,7 @@ public class Iterables2Test {
         list(9));
 
     // Attempt to trim all rows that have the default value.
-    Iterables.removeIf(meta, new Predicate<List<Integer>>() {
-      @Override public boolean apply(List<Integer> input) {
-        return Iterables.contains(input, DEFAULT);
-      }
-    });
+    Iterables.removeIf(meta, input -> Iterables.contains(input, DEFAULT));
 
     assertValues(meta, list(1, 5, 9));
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/commons/src/test/java/org/apache/aurora/common/net/http/handlers/TimeSeriesDataSourceTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/net/http/handlers/TimeSeriesDataSourceTest.java b/commons/src/test/java/org/apache/aurora/common/net/http/handlers/TimeSeriesDataSourceTest.java
index bdb237f..86de2cc 100644
--- a/commons/src/test/java/org/apache/aurora/common/net/http/handlers/TimeSeriesDataSourceTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/net/http/handlers/TimeSeriesDataSourceTest.java
@@ -114,11 +114,7 @@ public class TimeSeriesDataSourceTest extends EasyMockTest {
 
     Iterable<List<Number>> expectedData = Iterables2.zip(0,
         TIMESTAMPS, getSamples(TIME_SERIES_1), getSamples(TIME_SERIES_2));
-    expectedData = Iterables.filter(expectedData, new Predicate<List<Number>>() {
-        @Override public boolean apply(List<Number> row) {
-          return row.get(0).intValue() >= 3;
-        }
-      });
+    expectedData = Iterables.filter(expectedData, row -> row.get(0).intValue() >= 3);
 
     checkRows(expectedData, response.data);
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/commons/src/test/java/org/apache/aurora/common/testing/easymock/EasyMockTestTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/testing/easymock/EasyMockTestTest.java b/commons/src/test/java/org/apache/aurora/common/testing/easymock/EasyMockTestTest.java
index 40c5b8c..35dde9e 100644
--- a/commons/src/test/java/org/apache/aurora/common/testing/easymock/EasyMockTestTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/testing/easymock/EasyMockTestTest.java
@@ -37,11 +37,9 @@ public class EasyMockTestTest extends EasyMockTest {
 
     Runnable runnable = createMock(new Clazz<Runnable>() { });
     runnable.run();
-    expectLastCall().andAnswer(new IAnswer<Void>() {
-      @Override public Void answer() {
-        ran.set(true);
-        return null;
-      }
+    expectLastCall().andAnswer(() -> {
+      ran.set(true);
+      return null;
     });
     control.replay();
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/commons/src/test/java/org/apache/aurora/common/util/templating/StringTemplateHelperTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/util/templating/StringTemplateHelperTest.java b/commons/src/test/java/org/apache/aurora/common/util/templating/StringTemplateHelperTest.java
index 0988abc..fa2feb8 100644
--- a/commons/src/test/java/org/apache/aurora/common/util/templating/StringTemplateHelperTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/util/templating/StringTemplateHelperTest.java
@@ -54,16 +54,14 @@ public class StringTemplateHelperTest {
   @Test
   public void testFillTemplate() throws Exception {
     StringWriter output = new StringWriter();
-    templateHelper.writeTemplate(output, new Closure<StringTemplate>() {
-      @Override public void execute(StringTemplate template) {
-        template.setAttribute("header", "Prices");
-        template.setAttribute("items", Arrays.asList(
-            new Item("banana", 50),
-            new Item("car", 2),
-            new Item("jupiter", 200)
-        ));
-        template.setAttribute("footer", "The End");
-      }
+    templateHelper.writeTemplate(output, template -> {
+      template.setAttribute("header", "Prices");
+      template.setAttribute("items", Arrays.asList(
+          new Item("banana", 50),
+          new Item("car", 2),
+          new Item("jupiter", 200)
+      ));
+      template.setAttribute("footer", "The End");
     });
     String expected = "Prices\n"
         + "\n  The banana costs $50."
@@ -83,10 +81,8 @@ public class StringTemplateHelperTest {
 
   @Test(expected = CustomException.class)
   public void testClosureError() throws Exception {
-    templateHelper.writeTemplate(new StringWriter(), new Closure<StringTemplate>() {
-      @Override public void execute(StringTemplate template) {
-        throw new CustomException();
-      }
+    templateHelper.writeTemplate(new StringWriter(), template -> {
+      throw new CustomException();
     });
   }
 }

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/commons/src/test/java/org/apache/aurora/common/zookeeper/GroupTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/zookeeper/GroupTest.java b/commons/src/test/java/org/apache/aurora/common/zookeeper/GroupTest.java
index edfc109..729e7ae 100644
--- a/commons/src/test/java/org/apache/aurora/common/zookeeper/GroupTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/zookeeper/GroupTest.java
@@ -117,11 +117,7 @@ public class GroupTest extends BaseZooKeeperTest {
   @Test
   public void testSessionExpirationTriggersOnLoseMembership() throws Exception {
     final CountDownLatch lostMembership = new CountDownLatch(1);
-    Command onLoseMembership = new Command() {
-      @Override public void execute() throws RuntimeException {
-        lostMembership.countDown();
-      }
-    };
+    Command onLoseMembership = lostMembership::countDown;
     assertEmptyMembershipObserved();
 
     Membership membership = joinGroup.join(onLoseMembership);
@@ -134,11 +130,7 @@ public class GroupTest extends BaseZooKeeperTest {
   @Test
   public void testNodeDeleteTriggersOnLoseMembership() throws Exception {
     final CountDownLatch lostMembership = new CountDownLatch(1);
-    Command onLoseMembership = new Command() {
-      @Override public void execute() throws RuntimeException {
-        lostMembership.countDown();
-      }
-    };
+    Command onLoseMembership = lostMembership::countDown;
     assertEmptyMembershipObserved();
 
     Membership membership = joinGroup.join(onLoseMembership);

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/commons/src/test/java/org/apache/aurora/common/zookeeper/ServerSetImplTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/zookeeper/ServerSetImplTest.java b/commons/src/test/java/org/apache/aurora/common/zookeeper/ServerSetImplTest.java
index 5eb18e3..69749ed 100644
--- a/commons/src/test/java/org/apache/aurora/common/zookeeper/ServerSetImplTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/zookeeper/ServerSetImplTest.java
@@ -65,11 +65,7 @@ public class ServerSetImplTest extends BaseZooKeeperTest {
   @Before
   public void mySetUp() throws IOException {
     serverSetBuffer = new LinkedBlockingQueue<ImmutableSet<ServiceInstance>>();
-    serverSetMonitor = new DynamicHostSet.HostChangeMonitor<ServiceInstance>() {
-      @Override public void onChange(ImmutableSet<ServiceInstance> serverSet) {
-        serverSetBuffer.offer(serverSet);
-      }
-    };
+    serverSetMonitor = serverSetBuffer::offer;
   }
 
   private ServerSetImpl createServerSet() throws IOException {
@@ -273,10 +269,7 @@ public class ServerSetImplTest extends BaseZooKeeperTest {
     ServerSetImpl serverset = new ServerSetImpl(zkClient, group);
 
     try {
-      serverset.watch(new DynamicHostSet.HostChangeMonitor<ServiceInstance>() {
-        @Override
-        public void onChange(ImmutableSet<ServiceInstance> hostSet) {}
-      });
+      serverset.watch(hostSet -> {});
       fail("Expected MonitorException");
     } catch (DynamicHostSet.MonitorException e) {
       // expected
@@ -298,24 +291,16 @@ public class ServerSetImplTest extends BaseZooKeeperTest {
       throws InterruptedException {
     assertChangeFired(
         ImmutableSet.copyOf(Iterables.transform(ImmutableSet.copyOf(hostsStatuses.entrySet()),
-        new Function<Map.Entry<InetSocketAddress, Status>, ServiceInstance>() {
-          @Override public ServiceInstance apply(Map.Entry<InetSocketAddress, Status> e) {
-            return new ServiceInstance(new Endpoint(e.getKey().getHostName(), e.getKey().getPort()),
-                ImmutableMap.<String, Endpoint>of(), e.getValue());
-          }
-        })));
+            e -> new ServiceInstance(new Endpoint(e.getKey().getHostName(), e.getKey().getPort()),
+                ImmutableMap.<String, Endpoint>of(), e.getValue()))));
   }
 
   private void assertChangeFired(String... serviceHosts)
       throws InterruptedException {
 
     assertChangeFired(ImmutableSet.copyOf(Iterables.transform(ImmutableSet.copyOf(serviceHosts),
-        new Function<String, ServiceInstance>() {
-          @Override public ServiceInstance apply(String serviceHost) {
-            return new ServiceInstance(new Endpoint(serviceHost, 42),
-                ImmutableMap.<String, Endpoint>of(), Status.ALIVE);
-          }
-        })));
+        serviceHost -> new ServiceInstance(new Endpoint(serviceHost, 42),
+            ImmutableMap.<String, Endpoint>of(), Status.ALIVE))));
   }
 
   protected void assertChangeFiredEmpty() throws InterruptedException {

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/commons/src/test/java/org/apache/aurora/common/zookeeper/SingletonServiceTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/zookeeper/SingletonServiceTest.java b/commons/src/test/java/org/apache/aurora/common/zookeeper/SingletonServiceTest.java
index 167e242..454ae22 100644
--- a/commons/src/test/java/org/apache/aurora/common/zookeeper/SingletonServiceTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/zookeeper/SingletonServiceTest.java
@@ -60,11 +60,7 @@ public class SingletonServiceTest extends BaseZooKeeperTest {
   @SuppressWarnings("unchecked")
   public void mySetUp() throws IOException {
     control = createControl();
-    addTearDown(new TearDown() {
-      @Override public void tearDown() {
-        control.verify();
-      }
-    });
+    addTearDown(control::verify);
     listener = control.createMock(SingletonService.LeadershipListener.class);
     serverSet = control.createMock(ServerSet.class);
     candidate = control.createMock(Candidate.class);

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperClientTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperClientTest.java b/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperClientTest.java
index e074cf5..61a94b5 100644
--- a/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperClientTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperClientTest.java
@@ -63,17 +63,15 @@ public class ZooKeeperClientTest extends BaseZooKeeperTest {
 
     final CountDownLatch blockingGetComplete = new CountDownLatch(1);
     final AtomicReference<ZooKeeper> client = new AtomicReference<ZooKeeper>();
-    new Thread(new Runnable() {
-      @Override public void run() {
-        try {
-          client.set(zkClient.get());
-        } catch (ZooKeeperConnectionException e) {
-          throw new RuntimeException(e);
-        } catch (InterruptedException e) {
-          throw new RuntimeException(e);
-        } finally {
-          blockingGetComplete.countDown();
-        }
+    new Thread(() -> {
+      try {
+        client.set(zkClient.get());
+      } catch (ZooKeeperConnectionException e) {
+        throw new RuntimeException(e);
+      } catch (InterruptedException e) {
+        throw new RuntimeException(e);
+      } finally {
+        blockingGetComplete.countDown();
       }
     }).start();
 
@@ -116,18 +114,16 @@ public class ZooKeeperClientTest extends BaseZooKeeperTest {
     final CountDownLatch blockingGetComplete = new CountDownLatch(1);
     final AtomicBoolean interrupted = new AtomicBoolean();
     final AtomicReference<ZooKeeper> client = new AtomicReference<ZooKeeper>();
-    Thread getThread = new Thread(new Runnable() {
-      @Override public void run() {
-        try {
-          client.set(zkClient.get());
-        } catch (ZooKeeperConnectionException e) {
-          throw new RuntimeException(e);
-        } catch (InterruptedException e) {
-          interrupted.set(true);
-          throw new RuntimeException(e);
-        } finally {
-          blockingGetComplete.countDown();
-        }
+    Thread getThread = new Thread(() -> {
+      try {
+        client.set(zkClient.get());
+      } catch (ZooKeeperConnectionException e) {
+        throw new RuntimeException(e);
+      } catch (InterruptedException e) {
+        interrupted.set(true);
+        throw new RuntimeException(e);
+      } finally {
+        blockingGetComplete.countDown();
       }
     });
     getThread.start();

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java b/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java
index c13a3ba..2c09341 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java
@@ -40,7 +40,6 @@ import org.apache.aurora.scheduler.async.AsyncModule;
 import org.apache.aurora.scheduler.async.DelayExecutor;
 import org.apache.aurora.scheduler.configuration.executor.ExecutorSettings;
 import org.apache.aurora.scheduler.events.EventSink;
-import org.apache.aurora.scheduler.events.PubsubEvent;
 import org.apache.aurora.scheduler.filter.SchedulingFilter;
 import org.apache.aurora.scheduler.filter.SchedulingFilterImpl;
 import org.apache.aurora.scheduler.mesos.Driver;
@@ -55,6 +54,7 @@ import org.apache.aurora.scheduler.scheduling.TaskScheduler;
 import org.apache.aurora.scheduler.scheduling.TaskScheduler.TaskSchedulerImpl.ReservationDuration;
 import org.apache.aurora.scheduler.state.StateModule;
 import org.apache.aurora.scheduler.storage.Storage;
+import org.apache.aurora.scheduler.storage.Storage.MutateWork.NoResult;
 import org.apache.aurora.scheduler.storage.db.DbUtil;
 import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
@@ -155,12 +155,7 @@ public class SchedulingBenchmarks {
               bind(RescheduleCalculator.class).toInstance(new FakeRescheduleCalculator());
               bind(Clock.class).toInstance(clock);
               bind(StatsProvider.class).toInstance(new FakeStatsProvider());
-              bind(EventSink.class).toInstance(new EventSink() {
-                @Override
-                public void post(PubsubEvent event) {
-                  eventBus.post(event);
-                }
-              });
+              bind(EventSink.class).toInstance(eventBus::post);
             }
           }
       );
@@ -197,21 +192,14 @@ public class SchedulingBenchmarks {
     }
 
     private void saveTasks(final Set<IScheduledTask> tasks) {
-      storage.write(new Storage.MutateWork.NoResult.Quiet() {
-        @Override
-        public void execute(Storage.MutableStoreProvider storeProvider) {
-          storeProvider.getUnsafeTaskStore().saveTasks(tasks);
-        }
-      });
+      storage.write(
+          (NoResult.Quiet) storeProvider -> storeProvider.getUnsafeTaskStore().saveTasks(tasks));
     }
 
     private void saveHostAttributes(final Set<IHostAttributes> hostAttributesToSave) {
-      storage.write(new Storage.MutateWork.NoResult.Quiet() {
-        @Override
-        public void execute(Storage.MutableStoreProvider storeProvider) {
-          for (IHostAttributes attributes : hostAttributesToSave) {
-            storeProvider.getAttributeStore().saveHostAttributes(attributes);
-          }
+      storage.write((NoResult.Quiet) storeProvider -> {
+        for (IHostAttributes attributes : hostAttributesToSave) {
+          storeProvider.getAttributeStore().saveHostAttributes(attributes);
         }
       });
     }

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java b/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java
index 892d6ce..4e29e90 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java
@@ -66,11 +66,11 @@ import org.apache.aurora.scheduler.preemptor.ClusterStateImpl;
 import org.apache.aurora.scheduler.scheduling.RescheduleCalculator;
 import org.apache.aurora.scheduler.state.StateModule;
 import org.apache.aurora.scheduler.storage.Storage;
+import org.apache.aurora.scheduler.storage.Storage.MutateWork.NoResult;
 import org.apache.aurora.scheduler.storage.db.DbUtil;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 import org.apache.mesos.Protos;
 import org.apache.mesos.Scheduler;
-import org.apache.mesos.SchedulerDriver;
 import org.openjdk.jmh.annotations.Benchmark;
 import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.Fork;
@@ -190,33 +190,18 @@ public class StatusUpdateBenchmark {
                 .toInstance(AsyncUtil.singleThreadLoggingScheduledExecutor(
                     "SchedulerImpl-%d",
                     Logger.getLogger(StatusUpdateBenchmark.class.getName())));
-            bind(DriverFactory.class).toInstance(new DriverFactory() {
-              @Override
-              public SchedulerDriver create(
-                  Scheduler s,
-                  Optional<Protos.Credential> credentials,
-                  Protos.FrameworkInfo frameworkInfo,
-                  String master) {
-
-                return new FakeSchedulerDriver();
-              }
-            });
+            bind(DriverFactory.class)
+                .toInstance((s, credentials, frameworkInfo, master) -> new FakeSchedulerDriver());
             bind(OfferManager.class).toInstance(new FakeOfferManager());
             bind(TaskIdGenerator.class).to(TaskIdGenerator.TaskIdGeneratorImpl.class);
             bind(SchedulingFilter.class).to(SchedulingFilterImpl.class);
             bind(Command.class).annotatedWith(ShutdownStage.class).toInstance(
-                new Command() {
-                  @Override
-                  public void execute() throws RuntimeException {
-                    // no-op
-                  }
+                () -> {
+                  // no-op
                 });
             bind(Thread.UncaughtExceptionHandler.class).toInstance(
-                new Thread.UncaughtExceptionHandler() {
-                  @Override
-                  public void uncaughtException(Thread t, Throwable e) {
-                    // no-op
-                  }
+                (t, e) -> {
+                  // no-op
                 });
             bind(Storage.class).toInstance(storage);
             bind(DriverSettings.class).toInstance(
@@ -231,15 +216,10 @@ public class StatusUpdateBenchmark {
             bind(Clock.class).toInstance(new FakeClock());
             bind(ExecutorSettings.class).toInstance(TestExecutorSettings.THERMOS_EXECUTOR);
             bind(StatsProvider.class).toInstance(new FakeStatsProvider());
-            bind(EventSink.class).toInstance(new EventSink() {
-              @Override
-              public void post(PubsubEvent event) {
-                eventBus.post(event);
-              }
-            });
+            bind(EventSink.class).toInstance(eventBus::post);
             bind(new TypeLiteral<BlockingQueue<Protos.TaskStatus>>() { })
                 .annotatedWith(TaskStatusHandlerImpl.StatusUpdateQueue.class)
-                .toInstance(new LinkedBlockingQueue<Protos.TaskStatus>());
+                .toInstance(new LinkedBlockingQueue<>());
             bind(new TypeLiteral<Integer>() { })
                 .annotatedWith(TaskStatusHandlerImpl.MaxBatchSize.class)
                 .toInstance(1000);
@@ -283,12 +263,8 @@ public class StatusUpdateBenchmark {
         .setScheduleStatus(ScheduleStatus.STARTING)
         .build(NUM_TASKS);
 
-    storage.write(new Storage.MutateWork.NoResult.Quiet() {
-      @Override
-      public void execute(Storage.MutableStoreProvider storeProvider) {
-        storeProvider.getUnsafeTaskStore().saveTasks(tasks);
-      }
-    });
+    storage.write(
+        (NoResult.Quiet) storeProvider -> storeProvider.getUnsafeTaskStore().saveTasks(tasks));
 
     countDownLatch = new CountDownLatch(tasks.size());
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/jmh/java/org/apache/aurora/benchmark/ThriftApiBenchmarks.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/ThriftApiBenchmarks.java b/src/jmh/java/org/apache/aurora/benchmark/ThriftApiBenchmarks.java
index 06e22e1..fd182aa 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/ThriftApiBenchmarks.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/ThriftApiBenchmarks.java
@@ -14,7 +14,6 @@
 package org.apache.aurora.benchmark;
 
 import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.util.concurrent.TimeUnit;
 
@@ -160,31 +159,28 @@ public class ThriftApiBenchmarks {
   private static void bulkLoadTasks(Storage storage, final TestConfiguration config) {
     // Ideally we would use the API to populate the storage, but wiring in the writable thrift
     // interface requires considerably more binding setup.
-    storage.bulkLoad(new Storage.MutateWork.NoResult.Quiet() {
-      @Override
-      public void execute(Storage.MutableStoreProvider storeProvider) {
-        for (int roleId = 0; roleId < config.roles; roleId++) {
-          String role = "role" + roleId;
-          for (int envId = 0; envId < config.envs; envId++) {
-            String env = "env" + envId;
-            for (int jobId = 0; jobId < config.jobs; jobId++) {
-              String job = "job" + jobId;
-              ImmutableSet.Builder<IScheduledTask> tasks = ImmutableSet.builder();
-              tasks.addAll(new Tasks.Builder()
-                  .setRole(role)
-                  .setEnv(env)
-                  .setJob(job)
-                  .setScheduleStatus(ScheduleStatus.RUNNING)
-                  .build(config.instances));
-              tasks.addAll(new Tasks.Builder()
-                  .setRole(role)
-                  .setEnv(env)
-                  .setJob(job)
-                  .setScheduleStatus(ScheduleStatus.FINISHED)
-                  .setUuidStart(1)
-                  .build(config.deadTasks));
-              storeProvider.getUnsafeTaskStore().saveTasks(tasks.build());
-            }
+    storage.bulkLoad(storeProvider -> {
+      for (int roleId = 0; roleId < config.roles; roleId++) {
+        String role = "role" + roleId;
+        for (int envId = 0; envId < config.envs; envId++) {
+          String env = "env" + envId;
+          for (int jobId = 0; jobId < config.jobs; jobId++) {
+            String job = "job" + jobId;
+            ImmutableSet.Builder<IScheduledTask> tasks = ImmutableSet.builder();
+            tasks.addAll(new Tasks.Builder()
+                .setRole(role)
+                .setEnv(env)
+                .setJob(job)
+                .setScheduleStatus(ScheduleStatus.RUNNING)
+                .build(config.instances));
+            tasks.addAll(new Tasks.Builder()
+                .setRole(role)
+                .setEnv(env)
+                .setJob(job)
+                .setScheduleStatus(ScheduleStatus.FINISHED)
+                .setUuidStart(1)
+                .build(config.deadTasks));
+            storeProvider.getUnsafeTaskStore().saveTasks(tasks.build());
           }
         }
       }
@@ -192,11 +188,8 @@ public class ThriftApiBenchmarks {
   }
 
   private static <T> T createThrowingFake(Class<T> clazz) {
-    InvocationHandler handler = new InvocationHandler() {
-      @Override
-      public Object invoke(Object o, Method method, Object[] objects) throws Throwable {
-        throw new UnsupportedOperationException("This fake has no behavior.");
-      }
+    InvocationHandler handler = (o, method, objects) -> {
+      throw new UnsupportedOperationException("This fake has no behavior.");
     };
 
     @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/jmh/java/org/apache/aurora/benchmark/UpdateStoreBenchmarks.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/UpdateStoreBenchmarks.java b/src/jmh/java/org/apache/aurora/benchmark/UpdateStoreBenchmarks.java
index 9755ee5..1d8986b 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/UpdateStoreBenchmarks.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/UpdateStoreBenchmarks.java
@@ -25,6 +25,7 @@ import org.apache.aurora.gen.Lock;
 import org.apache.aurora.gen.LockKey;
 import org.apache.aurora.scheduler.storage.JobUpdateStore;
 import org.apache.aurora.scheduler.storage.Storage;
+import org.apache.aurora.scheduler.storage.Storage.MutateWork.NoResult;
 import org.apache.aurora.scheduler.storage.db.DbUtil;
 import org.apache.aurora.scheduler.storage.entities.IJobInstanceUpdateEvent;
 import org.apache.aurora.scheduler.storage.entities.IJobUpdateDetails;
@@ -69,56 +70,45 @@ public class UpdateStoreBenchmarks {
 
     @Setup(Level.Iteration)
     public void setUpIteration() {
-      storage.write(new Storage.MutateWork.NoResult.Quiet() {
-        @Override
-        public void execute(Storage.MutableStoreProvider storeProvider) {
-          JobUpdateStore.Mutable updateStore = storeProvider.getJobUpdateStore();
-          Set<IJobUpdateDetails> updates =
-              new JobUpdates.Builder().setNumInstanceEvents(instances).build(1);
+      storage.write((NoResult.Quiet) storeProvider -> {
+        JobUpdateStore.Mutable updateStore = storeProvider.getJobUpdateStore();
+        Set<IJobUpdateDetails> updates =
+            new JobUpdates.Builder().setNumInstanceEvents(instances).build(1);
 
-          ImmutableSet.Builder<IJobUpdateKey> keyBuilder = ImmutableSet.builder();
-          for (IJobUpdateDetails details : updates) {
-            IJobUpdateKey key = details.getUpdate().getSummary().getKey();
-            keyBuilder.add(key);
-            String lockToken = UUID.randomUUID().toString();
-            storeProvider.getLockStore().saveLock(
-                ILock.build(new Lock(LockKey.job(key.getJob().newBuilder()), lockToken, USER, 0L)));
+        ImmutableSet.Builder<IJobUpdateKey> keyBuilder = ImmutableSet.builder();
+        for (IJobUpdateDetails details : updates) {
+          IJobUpdateKey key = details.getUpdate().getSummary().getKey();
+          keyBuilder.add(key);
+          String lockToken = UUID.randomUUID().toString();
+          storeProvider.getLockStore().saveLock(
+              ILock.build(new Lock(LockKey.job(key.getJob().newBuilder()), lockToken, USER, 0L)));
 
-            updateStore.saveJobUpdate(details.getUpdate(), Optional.of(lockToken));
+          updateStore.saveJobUpdate(details.getUpdate(), Optional.of(lockToken));
 
-            for (IJobUpdateEvent updateEvent : details.getUpdateEvents()) {
-              updateStore.saveJobUpdateEvent(key, updateEvent);
-            }
+          for (IJobUpdateEvent updateEvent : details.getUpdateEvents()) {
+            updateStore.saveJobUpdateEvent(key, updateEvent);
+          }
 
-            for (IJobInstanceUpdateEvent instanceEvent : details.getInstanceEvents()) {
-              updateStore.saveJobInstanceUpdateEvent(key, instanceEvent);
-            }
+          for (IJobInstanceUpdateEvent instanceEvent : details.getInstanceEvents()) {
+            updateStore.saveJobInstanceUpdateEvent(key, instanceEvent);
           }
-          keys = keyBuilder.build();
         }
+        keys = keyBuilder.build();
       });
     }
 
     @TearDown(Level.Iteration)
     public void tearDownIteration() {
-      storage.write(new Storage.MutateWork.NoResult.Quiet() {
-        @Override
-        public void execute(Storage.MutableStoreProvider storeProvider) {
-          storeProvider.getJobUpdateStore().deleteAllUpdatesAndEvents();
-          storeProvider.getLockStore().deleteLocks();
-        }
+      storage.write((NoResult.Quiet) storeProvider -> {
+        storeProvider.getJobUpdateStore().deleteAllUpdatesAndEvents();
+        storeProvider.getLockStore().deleteLocks();
       });
     }
 
     @Benchmark
     public IJobUpdateDetails run() throws TException {
-      return storage.read(new Storage.Work.Quiet<IJobUpdateDetails>() {
-        @Override
-        public IJobUpdateDetails apply(Storage.StoreProvider store) {
-          return store.getJobUpdateStore().fetchJobUpdateDetails(
-              Iterables.getOnlyElement(keys)).get();
-        }
-      });
+      return storage.read(store -> store.getJobUpdateStore().fetchJobUpdateDetails(
+          Iterables.getOnlyElement(keys)).get());
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeStatsProvider.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeStatsProvider.java b/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeStatsProvider.java
index b1dfc01..d83a11f 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeStatsProvider.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeStatsProvider.java
@@ -48,11 +48,8 @@ public class FakeStatsProvider implements StatsProvider {
 
   @Override
   public RequestTimer makeRequestTimer(String name) {
-    return new RequestTimer() {
-      @Override
-      public void requestComplete(long latencyMicros) {
-        // no-op
-      }
+    return latencyMicros -> {
+      // no-op
     };
   }
 }

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/main/java/org/apache/aurora/scheduler/TaskStatusHandlerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/TaskStatusHandlerImpl.java b/src/main/java/org/apache/aurora/scheduler/TaskStatusHandlerImpl.java
index 09be688..1e820bd 100644
--- a/src/main/java/org/apache/aurora/scheduler/TaskStatusHandlerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/TaskStatusHandlerImpl.java
@@ -148,7 +148,7 @@ public class TaskStatusHandlerImpl extends AbstractExecutionThreadService
       pendingUpdates.drainTo(updates, maxBatchSize - updates.size());
 
       try {
-        storage.write((NoResult.Quiet) (Storage.MutableStoreProvider storeProvider) -> {
+        storage.write((NoResult.Quiet) storeProvider -> {
           for (TaskStatus status : updates) {
             ScheduleStatus translatedState = Conversions.convertProtoState(status.getState());
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java b/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java
index 9eda6e9..f355bc1 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java
@@ -175,7 +175,7 @@ class AuroraCronJob implements Job {
       return;
     }
 
-    storage.write((NoResult.Quiet) (Storage.MutableStoreProvider storeProvider) -> {
+    storage.write((NoResult.Quiet) storeProvider -> {
       for (String taskId : deferredLaunch.get().activeTaskIds) {
         stateManager.changeState(
             storeProvider,

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java
index 675e73d..f803913 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java
@@ -99,7 +99,7 @@ class CronJobManagerImpl implements CronJobManager {
     checkNoRunOverlap(config);
 
     final IJobKey jobKey = config.getSanitizedConfig().getJobConfig().getKey();
-    storage.write((NoResult<CronException>) (Storage.MutableStoreProvider storeProvider) -> {
+    storage.write((NoResult<CronException>) storeProvider -> {
       checkCronExists(jobKey, storeProvider.getCronJobStore());
 
       removeJob(jobKey, storeProvider.getCronJobStore());
@@ -115,7 +115,7 @@ class CronJobManagerImpl implements CronJobManager {
     checkNoRunOverlap(cronJob);
 
     final IJobKey jobKey = cronJob.getSanitizedConfig().getJobConfig().getKey();
-    storage.write((NoResult<CronException>) (Storage.MutableStoreProvider storeProvider) -> {
+    storage.write((NoResult<CronException>) storeProvider -> {
       checkNotExists(jobKey, storeProvider.getCronJobStore());
 
       saveJob(cronJob, storeProvider.getCronJobStore());

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java b/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java
index c4af2fd..469108a 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java
@@ -42,8 +42,6 @@ import org.apache.aurora.scheduler.offers.OfferManager;
 import org.apache.aurora.scheduler.stats.CachedCounters;
 import org.apache.aurora.scheduler.storage.AttributeStore;
 import org.apache.aurora.scheduler.storage.Storage;
-import org.apache.aurora.scheduler.storage.Storage.MutableStoreProvider;
-import org.apache.aurora.scheduler.storage.Storage.MutateWork;
 import org.apache.aurora.scheduler.storage.Storage.MutateWork.NoResult;
 import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
 import org.apache.mesos.Protos.ExecutorID;
@@ -159,19 +157,16 @@ public class MesosSchedulerImpl implements Scheduler {
     executor.execute(() -> {
       // TODO(wfarner): Reconsider the requirements here, augment the task scheduler to skip over
       //                offers when the host attributes cannot be found. (AURORA-137)
-      storage.write(new MutateWork.NoResult.Quiet() {
-        @Override
-        public void execute(MutableStoreProvider storeProvider) {
-          for (Offer offer : offers) {
-            IHostAttributes attributes =
-                AttributeStore.Util.mergeOffer(storeProvider.getAttributeStore(), offer);
-            storeProvider.getAttributeStore().saveHostAttributes(attributes);
-            if (log.isLoggable(Level.FINE)) {
-              log.log(Level.FINE, String.format("Received offer: %s", offer));
-            }
-            counters.get("scheduler_resource_offers").incrementAndGet();
-            offerManager.addOffer(new HostOffer(offer, attributes));
+      storage.write((NoResult.Quiet) storeProvider -> {
+        for (Offer offer : offers) {
+          IHostAttributes attributes =
+              AttributeStore.Util.mergeOffer(storeProvider.getAttributeStore(), offer);
+          storeProvider.getAttributeStore().saveHostAttributes(attributes);
+          if (log.isLoggable(Level.FINE)) {
+            log.log(Level.FINE, String.format("Received offer: %s", offer));
           }
+          counters.get("scheduler_resource_offers").incrementAndGet();
+          offerManager.addOffer(new HostOffer(offer, attributes));
         }
       });
     });

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/main/java/org/apache/aurora/scheduler/pruning/JobUpdateHistoryPruner.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/pruning/JobUpdateHistoryPruner.java b/src/main/java/org/apache/aurora/scheduler/pruning/JobUpdateHistoryPruner.java
index f29b7cf..fa4e3e8 100644
--- a/src/main/java/org/apache/aurora/scheduler/pruning/JobUpdateHistoryPruner.java
+++ b/src/main/java/org/apache/aurora/scheduler/pruning/JobUpdateHistoryPruner.java
@@ -27,7 +27,6 @@ import org.apache.aurora.common.quantity.Amount;
 import org.apache.aurora.common.quantity.Time;
 import org.apache.aurora.common.util.Clock;
 import org.apache.aurora.scheduler.storage.Storage;
-import org.apache.aurora.scheduler.storage.Storage.MutableStoreProvider;
 import org.apache.aurora.scheduler.storage.Storage.MutateWork.NoResult;
 import org.apache.aurora.scheduler.storage.entities.IJobUpdateKey;
 
@@ -76,7 +75,7 @@ class JobUpdateHistoryPruner extends AbstractIdleService {
   @Override
   protected void startUp() {
     executor.scheduleAtFixedRate(
-        () -> storage.write((NoResult.Quiet) (MutableStoreProvider storeProvider) -> {
+        () -> storage.write((NoResult.Quiet) storeProvider -> {
           Set<IJobUpdateKey> prunedUpdates = storeProvider.getJobUpdateStore().pruneHistory(
               settings.maxUpdatesPerJob,
               clock.nowMillis() - settings.maxHistorySize.as(Time.MILLISECONDS));

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/main/java/org/apache/aurora/scheduler/scheduling/TaskThrottler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/scheduling/TaskThrottler.java b/src/main/java/org/apache/aurora/scheduler/scheduling/TaskThrottler.java
index 787309a..bbd971a 100644
--- a/src/main/java/org/apache/aurora/scheduler/scheduling/TaskThrottler.java
+++ b/src/main/java/org/apache/aurora/scheduler/scheduling/TaskThrottler.java
@@ -74,17 +74,12 @@ class TaskThrottler implements EventSubscriber {
       long delayMs = Math.max(0, readyAtMs - clock.nowMillis());
       throttleStats.accumulate(delayMs);
       executor.execute(
-          () -> storage.write(new Storage.MutateWork.NoResult.Quiet() {
-            @Override
-            public void execute(Storage.MutableStoreProvider storeProvider) {
-              stateManager.changeState(
-                  storeProvider,
-                  stateChange.getTaskId(),
-                  Optional.of(THROTTLED),
-                  PENDING,
-                  Optional.absent());
-            }
-          }),
+          () -> storage.write(storeProvider -> stateManager.changeState(
+              storeProvider,
+              stateChange.getTaskId(),
+              Optional.of(THROTTLED),
+              PENDING,
+              Optional.absent())),
           Amount.of(delayMs, Time.MILLISECONDS));
     }
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/main/java/org/apache/aurora/scheduler/storage/CallOrderEnforcingStorage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/CallOrderEnforcingStorage.java b/src/main/java/org/apache/aurora/scheduler/storage/CallOrderEnforcingStorage.java
index 6a5069f..de4ada4 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/CallOrderEnforcingStorage.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/CallOrderEnforcingStorage.java
@@ -92,7 +92,7 @@ public class CallOrderEnforcingStorage implements NonVolatileStorage {
     checkInState(State.PREPARED);
     wrapped.start(initializationLogic);
     stateMachine.transition(State.READY);
-    wrapped.write((NoResult.Quiet) (MutableStoreProvider storeProvider) -> {
+    wrapped.write((NoResult.Quiet) storeProvider -> {
       Iterable<IScheduledTask> tasks = Tasks.LATEST_ACTIVITY.sortedCopy(
           storeProvider.getTaskStore().fetchTasks(Query.unscoped()));
       for (IScheduledTask task : tasks) {

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/main/java/org/apache/aurora/scheduler/storage/backup/Recovery.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/backup/Recovery.java b/src/main/java/org/apache/aurora/scheduler/storage/backup/Recovery.java
index 0f0218c..b74de9b 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/backup/Recovery.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/backup/Recovery.java
@@ -33,7 +33,6 @@ import org.apache.aurora.gen.storage.Snapshot;
 import org.apache.aurora.scheduler.base.Query;
 import org.apache.aurora.scheduler.storage.DistributedSnapshotStore;
 import org.apache.aurora.scheduler.storage.Storage;
-import org.apache.aurora.scheduler.storage.Storage.MutableStoreProvider;
 import org.apache.aurora.scheduler.storage.Storage.MutateWork.NoResult;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 
@@ -190,7 +189,7 @@ public interface Recovery {
       }
 
       void commit() {
-        primaryStorage.write((NoResult.Quiet) (MutableStoreProvider storeProvider) -> {
+        primaryStorage.write((NoResult.Quiet) storeProvider -> {
           try {
             distributedStore.persist(tempStorage.toSnapshot());
             shutDownNow.execute();

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/main/java/org/apache/aurora/scheduler/storage/backup/TemporaryStorage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/backup/TemporaryStorage.java b/src/main/java/org/apache/aurora/scheduler/storage/backup/TemporaryStorage.java
index f683f79..46b3d10 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/backup/TemporaryStorage.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/backup/TemporaryStorage.java
@@ -25,7 +25,6 @@ import org.apache.aurora.scheduler.base.Query;
 import org.apache.aurora.scheduler.base.Tasks;
 import org.apache.aurora.scheduler.storage.SnapshotStore;
 import org.apache.aurora.scheduler.storage.Storage;
-import org.apache.aurora.scheduler.storage.Storage.MutableStoreProvider;
 import org.apache.aurora.scheduler.storage.Storage.MutateWork.NoResult;
 import org.apache.aurora.scheduler.storage.db.DbUtil;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
@@ -80,7 +79,7 @@ interface TemporaryStorage {
       return new TemporaryStorage() {
         @Override
         public void deleteTasks(final Query.Builder query) {
-          storage.write((NoResult.Quiet) (MutableStoreProvider storeProvider) -> {
+          storage.write((NoResult.Quiet) storeProvider -> {
             Set<String> ids = FluentIterable.from(storeProvider.getTaskStore().fetchTasks(query))
                 .transform(Tasks::id)
                 .toSet();

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/main/java/org/apache/aurora/scheduler/storage/db/RowGarbageCollector.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/db/RowGarbageCollector.java b/src/main/java/org/apache/aurora/scheduler/storage/db/RowGarbageCollector.java
index 2684054..9ef377a 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/db/RowGarbageCollector.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/db/RowGarbageCollector.java
@@ -73,7 +73,7 @@ class RowGarbageCollector extends AbstractScheduledService {
 
     final AtomicLong deletedCount = new AtomicLong();
     for (Class<? extends GarbageCollectedTableMapper> tableClass : TABLES) {
-      storage.write((NoResult.Quiet) (Storage.MutableStoreProvider storeProvider) -> {
+      storage.write((NoResult.Quiet) storeProvider -> {
         try (SqlSession session = sessionFactory.openSession(true)) {
           GarbageCollectedTableMapper table = session.getMapper(tableClass);
           for (long rowId : table.selectAllRowIds()) {

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java b/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
index 8aaff22..3a6d3e4 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
@@ -310,12 +310,9 @@ public class LogStorage implements NonVolatileStorage, DistributedSnapshotStore
           LOG.info("Applying snapshot taken on " + new Date(snapshot.getTimestamp()));
           snapshotStore.applySnapshot(snapshot);
         })
-        .put(LogEntry._Fields.TRANSACTION, logEntry -> write(new MutateWork.NoResult.Quiet() {
-          @Override
-          public void execute(MutableStoreProvider unused) {
-            for (Op op : logEntry.getTransaction().getOps()) {
-              replayOp(op);
-            }
+        .put(LogEntry._Fields.TRANSACTION, logEntry -> write((NoResult.Quiet) unused -> {
+          for (Op op : logEntry.getTransaction().getOps()) {
+            replayOp(op);
           }
         }))
         .put(LogEntry._Fields.NOOP, item -> {

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java b/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
index 61058c7..3ede9a0 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
@@ -274,7 +274,7 @@ public class SnapshotStoreImpl implements SnapshotStore<Snapshot> {
   public void applySnapshot(final Snapshot snapshot) {
     requireNonNull(snapshot);
 
-    storage.write((NoResult.Quiet) (MutableStoreProvider storeProvider) -> {
+    storage.write((NoResult.Quiet) storeProvider -> {
       LOG.info("Restoring snapshot.");
 
       for (SnapshotField field : SNAPSHOT_FIELDS) {

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateControllerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateControllerImpl.java b/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateControllerImpl.java
index 94b6127..0e07560 100644
--- a/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateControllerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateControllerImpl.java
@@ -146,8 +146,7 @@ class JobUpdateControllerImpl implements JobUpdateController {
     requireNonNull(update);
     requireNonNull(auditData);
 
-    storage.write((NoResult<UpdateStateException>) (MutableStoreProvider storeProvider) -> {
-
+    storage.write((NoResult<UpdateStateException>) storeProvider -> {
       IJobUpdateSummary summary = update.getSummary();
       IJobUpdateInstructions instructions = update.getInstructions();
       IJobKey job = summary.getKey().getJob();
@@ -210,7 +209,7 @@ class JobUpdateControllerImpl implements JobUpdateController {
     requireNonNull(key);
     requireNonNull(auditData);
     LOG.info("Attempting to resume update " + key);
-    storage.write((NoResult<UpdateStateException>) (MutableStoreProvider storeProvider) -> {
+    storage.write((NoResult<UpdateStateException>) storeProvider -> {
       IJobUpdateDetails details = Iterables.getOnlyElement(
           storeProvider.getJobUpdateStore().fetchJobUpdateDetails(queryByUpdate(key)), null);
 
@@ -248,7 +247,7 @@ class JobUpdateControllerImpl implements JobUpdateController {
 
   @Override
   public void systemResume() {
-    storage.write((NoResult.Quiet) (MutableStoreProvider storeProvider) -> {
+    storage.write((NoResult.Quiet) storeProvider -> {
       for (IJobUpdateDetails details
           : storeProvider.getJobUpdateStore().fetchJobUpdateDetails(ACTIVE_QUERY)) {
 
@@ -321,7 +320,7 @@ class JobUpdateControllerImpl implements JobUpdateController {
   }
 
   private void instanceChanged(final IInstanceKey instance, final Optional<IScheduledTask> state) {
-    storage.write((NoResult.Quiet) (MutableStoreProvider storeProvider) -> {
+    storage.write((NoResult.Quiet) storeProvider -> {
       IJobKey job = instance.getJobKey();
       UpdateFactory.Update update = updates.get(job);
       if (update != null) {
@@ -370,7 +369,7 @@ class JobUpdateControllerImpl implements JobUpdateController {
       final Function<? super JobUpdateStatus, JobUpdateEvent> stateChange)
       throws UpdateStateException {
 
-    storage.write((NoResult<UpdateStateException>) (MutableStoreProvider storeProvider) -> {
+    storage.write((NoResult<UpdateStateException>) storeProvider -> {
 
       IJobUpdateSummary update = Iterables.getOnlyElement(
           storeProvider.getJobUpdateStore().fetchJobUpdateSummaries(queryByUpdate(key)), null);
@@ -695,7 +694,7 @@ class JobUpdateControllerImpl implements JobUpdateController {
   }
 
   private Runnable getDeferredEvaluator(final IInstanceKey instance, final IJobUpdateKey key) {
-    return () -> storage.write((NoResult.Quiet) (MutableStoreProvider storeProvider) -> {
+    return () -> storage.write((NoResult.Quiet) storeProvider -> {
       IJobUpdateSummary summary =
           getOnlyMatch(storeProvider.getJobUpdateStore(), queryByUpdate(key));
       JobUpdateStatus status = summary.getState().getStatus();

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/test/java/org/apache/aurora/scheduler/ResourceSlotTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/ResourceSlotTest.java b/src/test/java/org/apache/aurora/scheduler/ResourceSlotTest.java
index 175151a..e4ae943 100644
--- a/src/test/java/org/apache/aurora/scheduler/ResourceSlotTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/ResourceSlotTest.java
@@ -15,7 +15,6 @@ package org.apache.aurora.scheduler;
 
 import java.util.Set;
 
-import com.google.common.base.Function;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
@@ -169,12 +168,7 @@ public class ResourceSlotTest {
 
     Set<Pair<Long, Long>> actual = ImmutableSet.copyOf(Iterables.transform(
         resource.getRanges().getRangeList(),
-        new Function<Protos.Value.Range, Pair<Long, Long>>() {
-          @Override
-          public Pair<Long, Long> apply(Protos.Value.Range range) {
-            return Pair.of(range.getBegin(), range.getEnd());
-          }
-        }));
+        range -> Pair.of(range.getBegin(), range.getEnd())));
     assertEquals(expected, actual);
   }
 }

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/test/java/org/apache/aurora/scheduler/ResourcesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/ResourcesTest.java b/src/test/java/org/apache/aurora/scheduler/ResourcesTest.java
index 430e278..4fe8c51 100644
--- a/src/test/java/org/apache/aurora/scheduler/ResourcesTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/ResourcesTest.java
@@ -28,7 +28,6 @@ import org.apache.mesos.Protos.Value.Ranges;
 import org.junit.Test;
 
 import static org.apache.aurora.common.quantity.Data.MB;
-
 import static org.apache.aurora.scheduler.ResourceSlot.makeMesosResource;
 import static org.apache.aurora.scheduler.ResourceType.CPUS;
 import static org.apache.aurora.scheduler.ResourceType.DISK_MB;

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/test/java/org/apache/aurora/scheduler/TaskStatusHandlerImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/TaskStatusHandlerImplTest.java b/src/test/java/org/apache/aurora/scheduler/TaskStatusHandlerImplTest.java
index ea67c8d..0d41466 100644
--- a/src/test/java/org/apache/aurora/scheduler/TaskStatusHandlerImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/TaskStatusHandlerImplTest.java
@@ -32,7 +32,6 @@ import org.apache.mesos.Protos.TaskID;
 import org.apache.mesos.Protos.TaskState;
 import org.apache.mesos.Protos.TaskStatus;
 import org.easymock.EasyMock;
-import org.easymock.IAnswer;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -125,12 +124,9 @@ public class TaskStatusHandlerImplTest extends EasyMockTest {
         Optional.absent(),
         RUNNING,
         Optional.of("fake message")))
-        .andAnswer(new IAnswer<StateChangeResult>() {
-          @Override
-          public StateChangeResult answer() throws Throwable {
-            latch.countDown();
-            throw new StorageException("Injected error");
-          }
+        .andAnswer(() -> {
+          latch.countDown();
+          throw new StorageException("Injected error");
         });
 
     control.replay();
@@ -229,11 +225,8 @@ public class TaskStatusHandlerImplTest extends EasyMockTest {
 
     expect(queue.add(EasyMock.anyObject())).andReturn(true);
 
-    expect(queue.take()).andAnswer(new IAnswer<TaskStatus>() {
-      @Override
-      public TaskStatus answer() throws Throwable {
-        throw new RuntimeException();
-      }
+    expect(queue.take()).andAnswer(() -> {
+      throw new RuntimeException();
     });
 
     final CountDownLatch latch = new CountDownLatch(1);
@@ -257,12 +250,9 @@ public class TaskStatusHandlerImplTest extends EasyMockTest {
   }
 
   private static void waitAndAnswer(CountDownLatch latch) {
-    expectLastCall().andAnswer(new IAnswer<StateChangeResult>() {
-      @Override
-      public StateChangeResult answer() {
-        latch.countDown();
-        return null;
-      }
+    expectLastCall().andAnswer(() -> {
+      latch.countDown();
+      return null;
     });
   }
 }

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/test/java/org/apache/aurora/scheduler/TaskVarsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/TaskVarsTest.java b/src/test/java/org/apache/aurora/scheduler/TaskVarsTest.java
index de4fbbc..0a9dfe3 100644
--- a/src/test/java/org/apache/aurora/scheduler/TaskVarsTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/TaskVarsTest.java
@@ -21,7 +21,6 @@ import com.google.common.base.Supplier;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Maps;
 
-import org.apache.aurora.common.stats.Stat;
 import org.apache.aurora.common.stats.StatsProvider;
 import org.apache.aurora.common.testing.easymock.EasyMockTest;
 import org.apache.aurora.gen.AssignedTask;
@@ -43,7 +42,6 @@ import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 import org.apache.aurora.scheduler.storage.testing.StorageTestUtil;
 import org.easymock.EasyMock;
-import org.easymock.IAnswer;
 import org.easymock.IExpectationSetters;
 import org.junit.Before;
 import org.junit.Test;
@@ -100,16 +98,12 @@ public class TaskVarsTest extends EasyMockTest {
     expectStatExport(name, trackedProvider);
   }
 
-  private void expectStatExport(final String name, StatsProvider provider) {
+  private void expectStatExport(String name, StatsProvider provider) {
     expect(provider.makeGauge(EasyMock.eq(name), EasyMock.<Supplier<Long>>anyObject()))
-        .andAnswer(new IAnswer<Stat<Long>>() {
-          @SuppressWarnings("unchecked")
-          @Override
-          public Stat<Long> answer() {
-            assertFalse(globalCounters.containsKey(name));
-            globalCounters.put(name, (Supplier<Long>) EasyMock.getCurrentArguments()[1]);
-            return null;
-          }
+        .andAnswer(() -> {
+          assertFalse(globalCounters.containsKey(name));
+          globalCounters.put(name, (Supplier<Long>) EasyMock.getCurrentArguments()[1]);
+          return null;
         });
   }
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/d5d5a73c/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java b/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
index 88253d0..73f74ea 100644
--- a/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
+++ b/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
@@ -16,7 +16,6 @@ package org.apache.aurora.scheduler.app;
 import java.io.File;
 import java.net.InetSocketAddress;
 import java.util.Arrays;
-import java.util.concurrent.Callable;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -26,7 +25,6 @@ import java.util.concurrent.atomic.AtomicReference;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import com.google.common.base.Function;
 import com.google.common.base.Optional;
 import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableList;
@@ -45,11 +43,9 @@ import com.google.inject.Module;
 import org.apache.aurora.GuavaUtils;
 import org.apache.aurora.codec.ThriftBinaryCodec.CodingException;
 import org.apache.aurora.common.application.Lifecycle;
-import org.apache.aurora.common.net.pool.DynamicHostSet.HostChangeMonitor;
 import org.apache.aurora.common.quantity.Amount;
 import org.apache.aurora.common.quantity.Data;
 import org.apache.aurora.common.stats.Stats;
-import org.apache.aurora.common.thrift.ServiceInstance;
 import org.apache.aurora.common.zookeeper.ServerSet;
 import org.apache.aurora.common.zookeeper.ServerSetImpl;
 import org.apache.aurora.common.zookeeper.ZooKeeperClient;
@@ -96,7 +92,6 @@ import org.apache.mesos.Scheduler;
 import org.apache.mesos.SchedulerDriver;
 import org.easymock.Capture;
 import org.easymock.EasyMock;
-import org.easymock.IAnswer;
 import org.easymock.IMocksControl;
 import org.junit.Before;
 import org.junit.Rule;
@@ -154,16 +149,13 @@ public class SchedulerIT extends BaseZooKeeperTest {
   @Before
   public void mySetUp() throws Exception {
     control = createControl();
-    addTearDown(new TearDown() {
-      @Override
-      public void tearDown() {
-        if (mainException.get().isPresent()) {
-          RuntimeException e = mainException.get().get();
-          LOG.log(Level.SEVERE, "Scheduler main exited with an exception", e);
-          fail(e.getMessage());
-        }
-        control.verify();
+    addTearDown(() -> {
+      if (mainException.get().isPresent()) {
+        RuntimeException e = mainException.get().get();
+        LOG.log(Level.SEVERE, "Scheduler main exited with an exception", e);
+        fail(e.getMessage());
       }
+      control.verify();
     });
     backupDir = temporaryFolder.newFolder();
     driver = control.createMock(SchedulerDriver.class);
@@ -224,47 +216,35 @@ public class SchedulerIT extends BaseZooKeeperTest {
     injector.injectMembers(main);
     lifecycle = injector.getInstance(Lifecycle.class);
 
-    executor.submit(new Runnable() {
-      @Override
-      public void run() {
-        try {
-          main.run();
-        } catch (RuntimeException e) {
-          mainException.set(Optional.of(e));
-          executor.shutdownNow();
-        }
+    executor.submit(() -> {
+      try {
+        main.run();
+      } catch (RuntimeException e) {
+        mainException.set(Optional.of(e));
+        executor.shutdownNow();
       }
     });
-    addTearDown(new TearDown() {
-      @Override
-      public void tearDown() throws Exception {
-        lifecycle.shutdown();
-        MoreExecutors.shutdownAndAwaitTermination(executor, 10, TimeUnit.SECONDS);
-      }
+    addTearDown(() -> {
+      lifecycle.shutdown();
+      MoreExecutors.shutdownAndAwaitTermination(executor, 10, TimeUnit.SECONDS);
     });
     injector.getInstance(Key.get(GuavaUtils.ServiceManagerIface.class, AppStartup.class))
         .awaitHealthy();
   }
 
   private void awaitSchedulerReady() throws Exception {
-    executor.submit(new Callable<Void>() {
-      @Override
-      public Void call() throws Exception {
-        ServerSet schedulerService = new ServerSetImpl(zkClient, SERVERSET_PATH);
-        final CountDownLatch schedulerReady = new CountDownLatch(1);
-        schedulerService.watch(new HostChangeMonitor<ServiceInstance>() {
-          @Override
-          public void onChange(ImmutableSet<ServiceInstance> hostSet) {
-            if (!hostSet.isEmpty()) {
-              schedulerReady.countDown();
-            }
-          }
-        });
-        // A timeout is used because certain types of assertion errors (mocks) will not surface
-        // until the main test thread exits this body of code.
-        assertTrue(schedulerReady.await(5L, TimeUnit.MINUTES));
-        return null;
-      }
+    executor.submit(() -> {
+      ServerSet schedulerService = new ServerSetImpl(zkClient, SERVERSET_PATH);
+      final CountDownLatch schedulerReady = new CountDownLatch(1);
+      schedulerService.watch(hostSet -> {
+        if (!hostSet.isEmpty()) {
+          schedulerReady.countDown();
+        }
+      });
+      // A timeout is used because certain types of assertion errors (mocks) will not surface
+      // until the main test thread exits this body of code.
+      assertTrue(schedulerReady.await(5L, TimeUnit.MINUTES));
+      return null;
     }).get();
   }
 
@@ -287,19 +267,11 @@ public class SchedulerIT extends BaseZooKeeperTest {
 
   private Iterable<Entry> toEntries(LogEntry... entries) {
     return Iterables.transform(Arrays.asList(entries),
-        new Function<LogEntry, Entry>() {
-          @Override
-          public Entry apply(final LogEntry entry) {
-            return new Entry() {
-              @Override
-              public byte[] contents() {
-                try {
-                  return Iterables.getFirst(entrySerializer.serialize(entry), null);
-                } catch (CodingException e) {
-                  throw Throwables.propagate(e);
-                }
-              }
-            };
+        entry -> () -> {
+          try {
+            return Iterables.getFirst(entrySerializer.serialize(entry), null);
+          } catch (CodingException e) {
+            throw Throwables.propagate(e);
           }
         });
   }
@@ -347,29 +319,18 @@ public class SchedulerIT extends BaseZooKeeperTest {
         .andReturn(nextPosition());
 
     final CountDownLatch driverStarted = new CountDownLatch(1);
-    expect(driver.start()).andAnswer(new IAnswer<Status>() {
-      @Override
-      public Status answer() {
-        driverStarted.countDown();
-        return Status.DRIVER_RUNNING;
-      }
+    expect(driver.start()).andAnswer(() -> {
+      driverStarted.countDown();
+      return Status.DRIVER_RUNNING;
     });
 
     // Try to be a good test suite citizen by releasing the blocked thread when the test case exits.
     final CountDownLatch testCompleted = new CountDownLatch(1);
-    expect(driver.join()).andAnswer(new IAnswer<Status>() {
-      @Override
-      public Status answer() throws Throwable {
-        testCompleted.await();
-        return Status.DRIVER_STOPPED;
-      }
-    });
-    addTearDown(new TearDown() {
-      @Override
-      public void tearDown() {
-        testCompleted.countDown();
-      }
+    expect(driver.join()).andAnswer(() -> {
+      testCompleted.await();
+      return Status.DRIVER_STOPPED;
     });
+    addTearDown(testCompleted::countDown);
     expect(driver.stop(true)).andReturn(Status.DRIVER_STOPPED).anyTimes();
 
     control.replay();


Mime
View raw message