diff --git a/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/nodemanager/TestNMSimulator.java b/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/nodemanager/TestNMSimulator.java index f82ce916e1..6f7ff17924 100644 --- a/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/nodemanager/TestNMSimulator.java +++ b/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/nodemanager/TestNMSimulator.java @@ -157,13 +157,10 @@ public void testNMSimAppAddedAndRemoved() throws Exception { numClusterNodes = rm.getResourceScheduler().getNumClusterNodes(); } - GenericTestUtils.waitFor(new com.google.common.base.Supplier() { - @Override - public Boolean get() { - return rm.getResourceScheduler().getRootQueueMetrics() - .getAvailableMB() > 0; - } - }, 500, 10000); + GenericTestUtils.waitFor(() -> + rm.getResourceScheduler().getRootQueueMetrics() + .getAvailableMB() > 0, + 500, 10000); Assert.assertEquals("Node should have no runningApps.", node.getNode().getRunningApps().size(), 0); @@ -207,13 +204,10 @@ public void testNMSimNullAppAddedAndRemoved() throws Exception { numClusterNodes = rm.getResourceScheduler().getNumClusterNodes(); } - GenericTestUtils.waitFor(new com.google.common.base.Supplier() { - @Override - public Boolean get() { - return rm.getResourceScheduler().getRootQueueMetrics() - .getAvailableMB() > 0; - } - }, 500, 10000); + GenericTestUtils.waitFor(() -> + rm.getResourceScheduler().getRootQueueMetrics() + .getAvailableMB() > 0, + 500, 10000); Assert.assertEquals("Node should have no runningApps.", node.getNode().getRunningApps().size(), 0);