ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject [11/32] ambari git commit: AMBARI-21723. Redundant type arguments (Java 8)
Date Thu, 17 Aug 2017 10:16:17 GMT
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
index f5fc6e8..5d4c758 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
@@ -147,7 +147,7 @@ public class DataStoreImpl implements DataStore {
     try {
       em.getTransaction().begin();
       try {
-        DynamicEntity dynamicEntity = persistEntity(entity, em, new HashSet<DynamicEntity>());
+        DynamicEntity dynamicEntity = persistEntity(entity, em, new HashSet<>());
         em.getTransaction().commit();
         Map<String, Object> props = getEntityProperties(entity);
         List<String> keys = new ArrayList<>(props.keySet());

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/annotations/TransactionalLockInterceptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/annotations/TransactionalLockInterceptorTest.java b/ambari-server/src/test/java/org/apache/ambari/annotations/TransactionalLockInterceptorTest.java
index dcd1546..c9a62ca 100644
--- a/ambari-server/src/test/java/org/apache/ambari/annotations/TransactionalLockInterceptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/annotations/TransactionalLockInterceptorTest.java
@@ -30,7 +30,6 @@ import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
 import org.apache.ambari.server.orm.TransactionalLocks;
 import org.apache.ambari.server.orm.dao.HostRoleCommandDAO;
-import org.apache.ambari.server.orm.entities.HostRoleCommandEntity;
 import org.easymock.EasyMock;
 import org.junit.After;
 import org.junit.Before;
@@ -90,7 +89,7 @@ public class TransactionalLockInterceptorTest {
 
     // invoke method with annotations
     HostRoleCommandDAO hostRoleCommandDAO = m_injector.getInstance(HostRoleCommandDAO.class);
-    hostRoleCommandDAO.mergeAll(new ArrayList<HostRoleCommandEntity>());
+    hostRoleCommandDAO.mergeAll(new ArrayList<>());
 
     // verify locks are called
     EasyMock.verify(transactionalLocks, readWriteLock, readLock, writeLock);

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
index 7d97ee1..1a4935a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
@@ -198,13 +198,13 @@ public class ExecutionCommandWrapperTest {
     executionCommand.setRequestAndStage(1, 1);
     executionCommand.setHostname(HOST1);
     executionCommand.setRole("NAMENODE");
-    executionCommand.setRoleParams(Collections.<String, String>emptyMap());
+    executionCommand.setRoleParams(Collections.emptyMap());
     executionCommand.setRoleCommand(RoleCommand.START);
     executionCommand.setConfigurations(confs);
     executionCommand.setConfigurationTags(confTags);
     executionCommand.setServiceName("HDFS");
     executionCommand.setCommandType(AgentCommandType.EXECUTION_COMMAND);
-    executionCommand.setCommandParams(Collections.<String, String>emptyMap());
+    executionCommand.setCommandParams(Collections.emptyMap());
 
     String json = StageUtils.getGson().toJson(executionCommand, ExecutionCommand.class);
 
@@ -298,7 +298,7 @@ public class ExecutionCommandWrapperTest {
     executionCommand.setRequestAndStage(1, 1);
     executionCommand.setHostname(HOST1);
     executionCommand.setRole("NAMENODE");
-    executionCommand.setRoleParams(Collections.<String, String>emptyMap());
+    executionCommand.setRoleParams(Collections.emptyMap());
     executionCommand.setRoleCommand(RoleCommand.INSTALL);
     executionCommand.setServiceName("HDFS");
     executionCommand.setCommandType(AgentCommandType.EXECUTION_COMMAND);
@@ -322,7 +322,7 @@ public class ExecutionCommandWrapperTest {
     executionCommand.setRequestAndStage(1, 1);
     executionCommand.setHostname(HOST1);
     executionCommand.setRole("NAMENODE");
-    executionCommand.setRoleParams(Collections.<String, String> emptyMap());
+    executionCommand.setRoleParams(Collections.emptyMap());
     executionCommand.setRoleCommand(RoleCommand.START);
     executionCommand.setServiceName("HDFS");
     executionCommand.setCommandType(AgentCommandType.EXECUTION_COMMAND);

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/StageTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/StageTest.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/StageTest.java
index 15007f0..6b5fd12 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/StageTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/StageTest.java
@@ -74,7 +74,7 @@ public class StageTest {
         RoleCommand.EXECUTE,
         "cluster1",
         new ServiceComponentHostServerActionEvent(StageUtils.getHostName(), System.currentTimeMillis()),
-        Collections.<String, String> emptyMap(), null, null, 1200, false, false);
+        Collections.emptyMap(), null, null, 1200, false, false);
 
     List<ExecutionCommandWrapper> executionCommands = stage.getExecutionCommands(null);
     assertEquals(1, executionCommands.size());

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java
index e199724..b3c4e26 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java
@@ -476,7 +476,7 @@ public class HeartbeatProcessorTest {
     hb.setResponseId(0);
     hb.setHostname(DummyHostname1);
     hb.setNodeStatus(new HostStatus(HostStatus.Status.HEALTHY, DummyHostStatus));
-    hb.setReports(new ArrayList<CommandReport>());
+    hb.setReports(new ArrayList<>());
     ArrayList<ComponentStatus> componentStatuses = new ArrayList<>();
     ComponentStatus componentStatus1 = new ComponentStatus();
     componentStatus1.setClusterName(DummyCluster);
@@ -602,7 +602,7 @@ public class HeartbeatProcessorTest {
     cr.setRoleCommand("START");
     reports.add(cr);
     hb.setReports(reports);
-    hb.setComponentStatus(new ArrayList<ComponentStatus>());
+    hb.setComponentStatus(new ArrayList<>());
 
     final HostRoleCommand command = hostRoleCommandFactory.create(DummyHostname1,
         Role.DATANODE, null, null);
@@ -720,7 +720,7 @@ public class HeartbeatProcessorTest {
     cr.setExitCode(777);
     reports.add(cr);
     hb.setReports(reports);
-    hb.setComponentStatus(new ArrayList<ComponentStatus>());
+    hb.setComponentStatus(new ArrayList<>());
 
     final HostRoleCommand command = hostRoleCommandFactory.create(DummyHostname1,
         Role.DATANODE, null, null);
@@ -795,7 +795,7 @@ public class HeartbeatProcessorTest {
     hb.setResponseId(0);
     hb.setHostname(DummyHostname1);
     hb.setNodeStatus(new HostStatus(HostStatus.Status.HEALTHY, DummyHostStatus));
-    hb.setReports(new ArrayList<CommandReport>());
+    hb.setReports(new ArrayList<>());
 
     List<Map<String, String>> procs = new ArrayList<>();
     Map<String, String> proc1info = new HashMap<>();
@@ -845,7 +845,7 @@ public class HeartbeatProcessorTest {
     hb.setResponseId(1);
     hb.setHostname(DummyHostname1);
     hb.setNodeStatus(new HostStatus(HostStatus.Status.HEALTHY, DummyHostStatus));
-    hb.setReports(new ArrayList<CommandReport>());
+    hb.setReports(new ArrayList<>());
 
     componentStatus1 = new ComponentStatus();
     componentStatus1.setClusterName(DummyCluster);
@@ -1055,8 +1055,7 @@ public class HeartbeatProcessorTest {
   public void testHeartBeatWithAlertAndInvalidCluster() throws Exception {
     ActionManager am = actionManagerTestHelper.getMockActionManager();
 
-    expect(am.getTasks(EasyMock.<List<Long>>anyObject())).andReturn(
-        new ArrayList<HostRoleCommand>());
+    expect(am.getTasks(EasyMock.<List<Long>>anyObject())).andReturn(new ArrayList<>());
 
     replay(am);
 
@@ -1150,7 +1149,7 @@ public class HeartbeatProcessorTest {
     hb.setResponseId(0);
     hb.setNodeStatus(new HostStatus(HostStatus.Status.HEALTHY, DummyHostStatus));
     hb.setHostname(DummyHostname1);
-    hb.setComponentStatus(new ArrayList<ComponentStatus>());
+    hb.setComponentStatus(new ArrayList<>());
 
     StackId stackId = new StackId("HDP", "0.1");
 
@@ -1213,7 +1212,7 @@ public class HeartbeatProcessorTest {
     hb.setResponseId(0);
     hb.setNodeStatus(new HostStatus(HostStatus.Status.HEALTHY, DummyHostStatus));
     hb.setHostname(DummyHostname1);
-    hb.setComponentStatus(new ArrayList<ComponentStatus>());
+    hb.setComponentStatus(new ArrayList<>());
 
     StackId stackId = new StackId("HDP", "0.1");
 
@@ -1255,7 +1254,7 @@ public class HeartbeatProcessorTest {
     hb.setResponseId(0);
     hb.setHostname(DummyHostname1);
     hb.setNodeStatus(new HostStatus(HostStatus.Status.HEALTHY, DummyHostStatus));
-    hb.setReports(new ArrayList<CommandReport>());
+    hb.setReports(new ArrayList<>());
     ArrayList<ComponentStatus> componentStatuses = new ArrayList<>();
 
     ComponentStatus componentStatus1 = new ComponentStatus();

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatTestHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatTestHelper.java b/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatTestHelper.java
index c634191..7302896 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatTestHelper.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatTestHelper.java
@@ -192,7 +192,7 @@ public class HeartbeatTestHelper {
     cluster.setCurrentStackVersion(stackId);
 
     ConfigFactory cf = injector.getInstance(ConfigFactory.class);
-    Config config = cf.createNew(cluster, "cluster-env", "version1", configProperties, new HashMap<String, Map<String, String>>());
+    Config config = cf.createNew(cluster, "cluster-env", "version1", configProperties, new HashMap<>());
     cluster.addDesiredConfig("user", Collections.singleton(config));
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
index 77c90eb..b4ff5c1 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
@@ -174,7 +174,7 @@ public class TestHeartbeatHandler {
   @Test
   public void testHeartbeat() throws Exception {
     ActionManager am = actionManagerTestHelper.getMockActionManager();
-    expect(am.getTasks(EasyMock.<List<Long>>anyObject())).andReturn(new ArrayList<HostRoleCommand>());
+    expect(am.getTasks(EasyMock.<List<Long>>anyObject())).andReturn(new ArrayList<>());
     replay(am);
 
     Cluster cluster = heartbeatTestHelper.getDummyCluster();
@@ -241,7 +241,7 @@ public class TestHeartbeatHandler {
     hb.setResponseId(0);
     hb.setHostname(DummyHostname1);
     hb.setNodeStatus(new HostStatus(Status.HEALTHY, DummyHostStatus));
-    hb.setReports(new ArrayList<CommandReport>());
+    hb.setReports(new ArrayList<>());
     ArrayList<ComponentStatus> componentStatuses = new ArrayList<>();
     hb.setComponentStatus(componentStatuses);
 
@@ -269,7 +269,7 @@ public class TestHeartbeatHandler {
     hb.setResponseId(1);
     hb.setHostname(DummyHostname1);
     hb.setNodeStatus(new HostStatus(Status.HEALTHY, DummyHostStatus));
-    hb.setReports(new ArrayList<CommandReport>());
+    hb.setReports(new ArrayList<>());
     hb.setComponentStatus(componentStatuses);
 
     resp = handler.handleHeartBeat(hb);
@@ -305,7 +305,7 @@ public class TestHeartbeatHandler {
     hb.setResponseId(0);
     hb.setHostname(DummyHostname1);
     hb.setNodeStatus(new HostStatus(Status.HEALTHY, DummyHostStatus));
-    hb.setReports(new ArrayList<CommandReport>());
+    hb.setReports(new ArrayList<>());
     ArrayList<ComponentStatus> componentStatuses = new ArrayList<>();
 
     ComponentStatus componentStatus1 = new ComponentStatus();
@@ -745,7 +745,7 @@ public class TestHeartbeatHandler {
     hs.setCause("");
     hs.setStatus(status);
     heartBeat.setNodeStatus(hs);
-    heartBeat.setReports(Collections.<CommandReport>emptyList());
+    heartBeat.setReports(Collections.emptyList());
 
     return heartBeat;
   }
@@ -822,7 +822,7 @@ public class TestHeartbeatHandler {
     cr.setExitCode(777);
     reports.add(cr);
     hb.setReports(reports);
-    hb.setComponentStatus(new ArrayList<ComponentStatus>());
+    hb.setComponentStatus(new ArrayList<>());
 
     final HostRoleCommand command = hostRoleCommandFactory.create(DummyHostname1,
             Role.DATANODE, null, RoleCommand.INSTALL);
@@ -891,7 +891,7 @@ public class TestHeartbeatHandler {
     cr.setExitCode(777);
     reports.add(cr);
     hb.setReports(reports);
-    hb.setComponentStatus(new ArrayList<ComponentStatus>());
+    hb.setComponentStatus(new ArrayList<>());
 
     final HostRoleCommand command = hostRoleCommandFactory.create(DummyHostname1,
             Role.DATANODE, null, null);
@@ -938,9 +938,9 @@ public class TestHeartbeatHandler {
     hb.setResponseId(0);
     hb.setHostname(DummyHostname1);
     hb.setNodeStatus(new HostStatus(Status.HEALTHY, DummyHostStatus));
-    hb.setReports(new ArrayList<CommandReport>());
+    hb.setReports(new ArrayList<>());
     hb.setAgentEnv(new AgentEnv());
-    hb.setMounts(new ArrayList<DiskInfo>());
+    hb.setMounts(new ArrayList<>());
 
     ArrayList<ComponentStatus> componentStatuses = new ArrayList<>();
     ComponentStatus componentStatus1 = createComponentStatus(DummyCluster, HDFS, DummyHostStatus, State.STARTED,
@@ -957,7 +957,7 @@ public class TestHeartbeatHandler {
 
     ActionQueue aq = new ActionQueue();
     ActionManager am = actionManagerTestHelper.getMockActionManager();
-    expect(am.getTasks(EasyMock.<List<Long>>anyObject())).andReturn(new ArrayList<HostRoleCommand>());
+    expect(am.getTasks(EasyMock.<List<Long>>anyObject())).andReturn(new ArrayList<>());
     replay(am);
 
     HeartBeatHandler handler = heartbeatTestHelper.getHeartBeatHandler(am, aq);
@@ -1387,7 +1387,7 @@ public class TestHeartbeatHandler {
     hb.setResponseId(0);
     hb.setHostname(DummyHostname1);
     hb.setNodeStatus(new HostStatus(Status.HEALTHY, DummyHostStatus));
-    hb.setReports(new ArrayList<CommandReport>());
+    hb.setReports(new ArrayList<>());
 
     ArrayList<ComponentStatus> componentStatuses = new ArrayList<>();
     ComponentStatus componentStatus1 = new ComponentStatus();

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java
index b596d27..1021175 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java
@@ -161,7 +161,7 @@ public class TestHeartbeatMonitor {
 
     ConfigFactory configFactory = injector.getInstance(ConfigFactory.class);
     Config config = configFactory.createNew(cluster, "hadoop-env", "version1",
-        new HashMap<String,String>() {{ put("a", "b"); }}, new HashMap<String, Map<String,String>>());
+        new HashMap<String,String>() {{ put("a", "b"); }}, new HashMap<>());
     cluster.addDesiredConfig("_test", Collections.singleton(config));
 
 
@@ -245,13 +245,13 @@ public class TestHeartbeatMonitor {
     Config hadoopEnvConfig = configFactory.createNew(cluster, "hadoop-env", "version1",
       new HashMap<String, String>() {{
         put("a", "b");
-      }}, new HashMap<String, Map<String,String>>());
+      }}, new HashMap<>());
 
 
     Config hbaseEnvConfig = configFactory.createNew(cluster, "hbase-env", "version1",
             new HashMap<String, String>() {{
               put("a", "b");
-            }}, new HashMap<String, Map<String,String>>());
+            }}, new HashMap<>());
 
     cluster.addDesiredConfig("_test", Collections.singleton(hadoopEnvConfig));
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/alerts/AmbariPerformanceRunnableTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/alerts/AmbariPerformanceRunnableTest.java b/ambari-server/src/test/java/org/apache/ambari/server/alerts/AmbariPerformanceRunnableTest.java
index d32b088..40280fa 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/alerts/AmbariPerformanceRunnableTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/alerts/AmbariPerformanceRunnableTest.java
@@ -220,8 +220,7 @@ public class AmbariPerformanceRunnableTest {
   public void testAlertFiresUnknownEvent() {
     // mock one area, leaving others to fail
     RequestDAO requestDAO = m_injector.getInstance(RequestDAO.class);
-    expect(requestDAO.findAllRequestIds(EasyMock.anyInt(), EasyMock.anyBoolean())).andReturn(
-        new ArrayList<Long>());
+    expect(requestDAO.findAllRequestIds(EasyMock.anyInt(), EasyMock.anyBoolean())).andReturn(new ArrayList<>());
 
     replay(requestDAO);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/alerts/ComponentVersionAlertRunnableTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/alerts/ComponentVersionAlertRunnableTest.java b/ambari-server/src/test/java/org/apache/ambari/server/alerts/ComponentVersionAlertRunnableTest.java
index e41f568..00b65e1 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/alerts/ComponentVersionAlertRunnableTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/alerts/ComponentVersionAlertRunnableTest.java
@@ -134,8 +134,8 @@ public class ComponentVersionAlertRunnableTest extends EasyMockSupport {
     m_hosts.add(host1);
     m_hosts.add(host2);
 
-    m_hostComponentMap.put(HOSTNAME_1, new ArrayList<ServiceComponentHost>());
-    m_hostComponentMap.put(HOSTNAME_2, new ArrayList<ServiceComponentHost>());
+    m_hostComponentMap.put(HOSTNAME_1, new ArrayList<>());
+    m_hostComponentMap.put(HOSTNAME_2, new ArrayList<>());
 
     // desired stack
     m_desidredStackId = createNiceMock(StackId.class);

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/handlers/ReadHandlerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/handlers/ReadHandlerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/handlers/ReadHandlerTest.java
index 51d3440..e709c37 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/handlers/ReadHandlerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/handlers/ReadHandlerTest.java
@@ -158,7 +158,7 @@ public class ReadHandlerTest {
     expect(request.getSortRequest()).andReturn(null);
     expect(request.getRenderer()).andReturn(renderer);
     expect(request.getBody()).andReturn(null);
-    expect(request.getFields()).andReturn(Collections.<String, TemporalInfo>emptyMap());
+    expect(request.getFields()).andReturn(Collections.emptyMap());
 
     expect(request.getQueryPredicate()).andReturn(predicate);
     query.setUserPredicate(predicate);
@@ -194,7 +194,7 @@ public class ReadHandlerTest {
     expect(request.getSortRequest()).andReturn(null);
     expect(request.getRenderer()).andReturn(renderer);
     expect(request.getBody()).andReturn(null);
-    expect(request.getFields()).andReturn(Collections.<String, TemporalInfo>emptyMap());
+    expect(request.getFields()).andReturn(Collections.emptyMap());
 
     expect(request.getQueryPredicate()).andReturn(predicate);
     query.setUserPredicate(predicate);
@@ -231,7 +231,7 @@ public class ReadHandlerTest {
     expect(request.getSortRequest()).andReturn(null);
     expect(request.getRenderer()).andReturn(renderer);
     expect(request.getBody()).andReturn(null);
-    expect(request.getFields()).andReturn(Collections.<String, TemporalInfo>emptyMap());
+    expect(request.getFields()).andReturn(Collections.emptyMap());
 
     expect(request.getQueryPredicate()).andReturn(predicate);
     query.setUserPredicate(predicate);
@@ -267,7 +267,7 @@ public class ReadHandlerTest {
     expect(request.getSortRequest()).andReturn(null);
     expect(request.getRenderer()).andReturn(renderer);
     expect(request.getBody()).andReturn(null);
-    expect(request.getFields()).andReturn(Collections.<String, TemporalInfo>emptyMap());
+    expect(request.getFields()).andReturn(Collections.emptyMap());
 
     expect(request.getQueryPredicate()).andReturn(predicate).anyTimes();
     query.setUserPredicate(predicate);
@@ -302,7 +302,7 @@ public class ReadHandlerTest {
     expect(request.getSortRequest()).andReturn(null);
     expect(request.getRenderer()).andReturn(renderer);
     expect(request.getBody()).andReturn(null);
-    expect(request.getFields()).andReturn(Collections.<String, TemporalInfo>emptyMap());
+    expect(request.getFields()).andReturn(Collections.emptyMap());
 
     expect(request.getQueryPredicate()).andReturn(null).anyTimes();
     query.setUserPredicate(null);
@@ -338,7 +338,7 @@ public class ReadHandlerTest {
     expect(request.getSortRequest()).andReturn(null);
     expect(request.getRenderer()).andReturn(renderer);
     expect(request.getBody()).andReturn(null);
-    expect(request.getFields()).andReturn(Collections.<String, TemporalInfo>emptyMap());
+    expect(request.getFields()).andReturn(Collections.emptyMap());
 
     expect(request.getQueryPredicate()).andReturn(predicate);
     query.setUserPredicate(predicate);

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/QueryParserTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/QueryParserTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/QueryParserTest.java
index e6c628d..dcfd89b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/QueryParserTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/QueryParserTest.java
@@ -207,7 +207,7 @@ public class QueryParserTest {
 
   @Test
   public void testParse_InOp__HostName_Empty() throws Exception {
-    List<Token> listTokens = new ArrayList<Token>();
+    List<Token> listTokens = new ArrayList<>();
     // foo.in(one,two,3)
     listTokens.add(new Token(Token.TYPE.RELATIONAL_OPERATOR_FUNC, ".in("));
     listTokens.add(new Token(Token.TYPE.PROPERTY_OPERAND, "Hosts/host_name"));

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java
index 0d3aca4..b207ff8 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java
@@ -95,7 +95,7 @@ public class QueryImplTest {
 
     // expectations
     expect(resourceDefinition.getType()).andReturn(Resource.Type.Service).anyTimes();
-    expect(resourceDefinition.getSubResourceDefinitions()).andReturn(Collections.<SubResourceDefinition>emptySet()).anyTimes();
+    expect(resourceDefinition.getSubResourceDefinitions()).andReturn(Collections.emptySet()).anyTimes();
 
     replay(resourceDefinition);
 
@@ -116,7 +116,7 @@ public class QueryImplTest {
 
     // expectations
     expect(resourceDefinition.getType()).andReturn(Resource.Type.Service).anyTimes();
-    expect(resourceDefinition.getSubResourceDefinitions()).andReturn(Collections.<SubResourceDefinition>emptySet()).anyTimes();
+    expect(resourceDefinition.getSubResourceDefinitions()).andReturn(Collections.emptySet()).anyTimes();
 
     replay(resourceDefinition);
 
@@ -287,12 +287,12 @@ public class QueryImplTest {
         andReturn(queryResponse);
 
     // Always return an empty set of resources.
-    expect(queryResponse.getResources()).andReturn(Collections.<Resource>emptySet()).anyTimes();
+    expect(queryResponse.getResources()).andReturn(Collections.emptySet()).anyTimes();
 
     expect(schema.getKeyPropertyId(Resource.Type.Cluster)).andReturn("Clusters/cluster_name").anyTimes();
 
     TreeNode<Set<String>> treeNode = new TreeNodeImpl<>(null, Collections.<String>emptySet(), null);
-    expect(renderer.finalizeProperties(EasyMock.<TreeNode<QueryInfo>>anyObject(), anyBoolean())).andReturn(treeNode).anyTimes();
+    expect(renderer.finalizeProperties(EasyMock.anyObject(), anyBoolean())).andReturn(treeNode).anyTimes();
 
     replay(clusterController, queryResponse, schema, renderer);
 
@@ -360,7 +360,7 @@ public class QueryImplTest {
     expect(clusterResource.getPropertyValue("Clusters/cluster_name")).andReturn("c1").anyTimes();
 
     TreeNode<Set<String>> treeNode = new TreeNodeImpl<>(null, Collections.<String>emptySet(), null);
-    expect(renderer.finalizeProperties(EasyMock.<TreeNode<QueryInfo>>anyObject(), anyBoolean())).andReturn(treeNode).anyTimes();
+    expect(renderer.finalizeProperties(EasyMock.anyObject(), anyBoolean())).andReturn(treeNode).anyTimes();
 
     expect(clusterController.getIterable(eq(Resource.Type.Cluster), anyObject(QueryResponse.class),
       anyObject(org.apache.ambari.server.controller.spi.Request.class), anyObject(Predicate.class),
@@ -408,12 +408,12 @@ public class QueryImplTest {
     expect(iterator.hasNext()).andReturn(false).anyTimes();
 
     // Always return an empty set of resources.
-    expect(queryResponse.getResources()).andReturn(Collections.<Resource>emptySet()).anyTimes();
+    expect(queryResponse.getResources()).andReturn(Collections.emptySet()).anyTimes();
 
     expect(schema.getKeyPropertyId(Resource.Type.Cluster)).andReturn("Clusters/cluster_name").anyTimes();
 
     TreeNode<Set<String>> treeNode = new TreeNodeImpl<>(null, Collections.<String>emptySet(), null);
-    expect(renderer.finalizeProperties(EasyMock.<TreeNode<QueryInfo>>anyObject(), anyBoolean())).andReturn(treeNode).anyTimes();
+    expect(renderer.finalizeProperties(EasyMock.anyObject(), anyBoolean())).andReturn(treeNode).anyTimes();
 
     Capture<Result> resultCapture = EasyMock.newCapture();
 
@@ -422,7 +422,7 @@ public class QueryImplTest {
     replay(clusterController, queryResponse, schema, renderer, iterable, iterator);
 
     //test
-    QueryImpl query = new TestQuery(new HashMap<Resource.Type, String>(), resourceDefinition, clusterController);
+    QueryImpl query = new TestQuery(new HashMap<>(), resourceDefinition, clusterController);
     query.setRenderer(renderer);
 
     query.execute();
@@ -959,7 +959,7 @@ public class QueryImplTest {
     expect(mockSubResourceDefinition.isCollection()).andReturn(false).atLeastOnce();
 
     expect(mockSchema.getKeyPropertyId(isA(Resource.Type.class))).andReturn("test-value").anyTimes();
-    expect(mockSchema.getKeyTypes()).andReturn(Collections.<Resource.Type>emptySet()).anyTimes();
+    expect(mockSchema.getKeyTypes()).andReturn(Collections.emptySet()).anyTimes();
 
     mockRenderer.init(isA(SchemaFactory.class));
     // the mock renderer should return false for requiresPropertyProviderInput, to
@@ -1038,7 +1038,7 @@ public class QueryImplTest {
     expect(mockSubResourceDefinition.isCollection()).andReturn(false).atLeastOnce();
 
     expect(mockSchema.getKeyPropertyId(isA(Resource.Type.class))).andReturn("test-value").anyTimes();
-    expect(mockSchema.getKeyTypes()).andReturn(Collections.<Resource.Type>emptySet()).anyTimes();
+    expect(mockSchema.getKeyTypes()).andReturn(Collections.emptySet()).anyTimes();
 
     mockRenderer.init(isA(SchemaFactory.class));
     // simulate the case of a renderer that requires the property providers to execute
@@ -1055,9 +1055,9 @@ public class QueryImplTest {
     expect(mockClusterController.getIterable(eq(Resource.Type.Host), isA(QueryResponse.class), isA(Request.class),(Predicate)eq(null), (PageRequest)eq(null), (SortRequest)eq(null))).andReturn(Collections.singleton(mockResource)).atLeastOnce();
     expect(mockClusterController.getIterable(eq(Resource.Type.Configuration), isA(QueryResponse.class), isA(Request.class),(Predicate)eq(null), (PageRequest)eq(null), (SortRequest)eq(null))).andReturn(Collections.singleton(mockResource)).atLeastOnce();
     // expect call to activate property providers for Host resource
-    expect(mockClusterController.populateResources(eq(Resource.Type.Host), eq(Collections.singleton(mockResource)), isA(Request.class), (Predicate)eq(null))).andReturn(Collections.<Resource>emptySet()).times(1);
+    expect(mockClusterController.populateResources(eq(Resource.Type.Host), eq(Collections.singleton(mockResource)), isA(Request.class), (Predicate)eq(null))).andReturn(Collections.emptySet()).times(1);
     // expect call to activate property providers for Configuration sub-resource
-    expect(mockClusterController.populateResources(eq(Resource.Type.Configuration), eq(Collections.singleton(mockResource)), isA(Request.class), (Predicate)eq(null))).andReturn(Collections.<Resource>emptySet()).times(1);
+    expect(mockClusterController.populateResources(eq(Resource.Type.Configuration), eq(Collections.singleton(mockResource)), isA(Request.class), (Predicate)eq(null))).andReturn(Collections.emptySet()).times(1);
 
     expect(mockQueryResponse.getResources()).andReturn(Collections.singleton(mockResource)).atLeastOnce();
     expect(mockSubQueryResponse.getResources()).andReturn(Collections.singleton(mockResource)).atLeastOnce();

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryInfoTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryInfoTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryInfoTest.java
index 51eda2b..a60b729 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryInfoTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryInfoTest.java
@@ -43,7 +43,7 @@ public class QueryInfoTest {
   @Test
   public void testGetResource() {
     ResourceDefinition resource = new ClusterResourceDefinition();
-    QueryInfo info = new QueryInfo(resource, new HashSet<String>());
+    QueryInfo info = new QueryInfo(resource, new HashSet<>());
 
     assertSame(resource, info.getResource());
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRendererTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRendererTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRendererTest.java
index d6521f9..6be9f32 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRendererTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRendererTest.java
@@ -112,8 +112,7 @@ public class ClusterBlueprintRendererTest {
   private static final HostGroup group1 = createNiceMock(HostGroup.class);
   private static final HostGroup group2 = createNiceMock(HostGroup.class);
 
-  private static final Configuration emptyConfiguration = new Configuration(new HashMap<String, Map<String, String>>(),
-      new HashMap<String, Map<String, Map<String, String>>>());
+  private static final Configuration emptyConfiguration = new Configuration(new HashMap<>(), new HashMap<>());
 
   private static final Map<String, Map<String, String>> clusterProps = new HashMap<>();
   private static final Map<String, Map<String, Map<String, String>>> clusterAttributes =
@@ -180,7 +179,7 @@ public class ClusterBlueprintRendererTest {
     expect(controller.getKerberosHelper()).andReturn(kerberosHelper).anyTimes();
     expect(controller.getClusters()).andReturn(clusters).anyTimes();
     expect(kerberosHelper.getKerberosDescriptor(cluster)).andReturn(kerberosDescriptor).anyTimes();
-    Set<String> properties = new HashSet<String>();
+    Set<String> properties = new HashSet<>();
     properties.add("core-site/hadoop.security.auth_to_local");
     expect(kerberosDescriptor.getAllAuthToLocalProperties()).andReturn(properties).anyTimes();
     expect(ambariContext.getClusterName(1L)).andReturn("clusterName").anyTimes();
@@ -226,7 +225,7 @@ public class ClusterBlueprintRendererTest {
       (Predicate) anyObject(Predicate.class))).andReturn(result).once();
 
     Map<String, Map<String, Object>> resourcePropertiesMap = new HashMap<>();
-    resourcePropertiesMap.put(ArtifactResourceProvider.ARTIFACT_DATA_PROPERTY, Collections.<String, Object>emptyMap());
+    resourcePropertiesMap.put(ArtifactResourceProvider.ARTIFACT_DATA_PROPERTY, Collections.emptyMap());
     Map<String, Object> propertiesMap = new HashMap<>();
     propertiesMap.put("testProperty", "testValue");
     resourcePropertiesMap.put(ArtifactResourceProvider.ARTIFACT_DATA_PROPERTY + "/properties", propertiesMap);
@@ -246,15 +245,15 @@ public class ClusterBlueprintRendererTest {
 
   @Test
   public void testFinalizeProperties__instance() {
-    QueryInfo rootQuery = new QueryInfo(new ClusterResourceDefinition(), new HashSet<String>());
+    QueryInfo rootQuery = new QueryInfo(new ClusterResourceDefinition(), new HashSet<>());
     TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Cluster");
     rootQuery.getProperties().add("foo/bar");
     rootQuery.getProperties().add("prop1");
 
-    QueryInfo hostInfo = new QueryInfo(new HostResourceDefinition(), new HashSet<String>());
+    QueryInfo hostInfo = new QueryInfo(new HostResourceDefinition(), new HashSet<>());
     queryTree.addChild(hostInfo, "Host");
 
-    QueryInfo hostComponentInfo = new QueryInfo(new HostComponentResourceDefinition(), new HashSet<String>());
+    QueryInfo hostComponentInfo = new QueryInfo(new HostComponentResourceDefinition(), new HashSet<>());
     queryTree.getChild("Host").addChild(hostComponentInfo, "HostComponent");
 
     ClusterBlueprintRenderer renderer = new ClusterBlueprintRenderer();
@@ -413,7 +412,7 @@ public class ClusterBlueprintRendererTest {
 
   @Test
   public void testFinalizeProperties__instance_noComponentNode() {
-    QueryInfo rootQuery = new QueryInfo(new ClusterResourceDefinition(), new HashSet<String>());
+    QueryInfo rootQuery = new QueryInfo(new ClusterResourceDefinition(), new HashSet<>());
     TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Cluster");
     rootQuery.getProperties().add("foo/bar");
     rootQuery.getProperties().add("prop1");
@@ -674,7 +673,7 @@ public class ClusterBlueprintRendererTest {
 
         if (desiredConfig == null) {
           // override the properties map for simpler testing
-          originalMap.put("Clusters/desired_configs", Collections.<String, Object>emptyMap());
+          originalMap.put("Clusters/desired_configs", Collections.emptyMap());
         } else {
           // allow for unit tests to customize this, needed for attributes export testing
           originalMap.put("Clusters/desired_configs", desiredConfig);
@@ -723,8 +722,8 @@ public class ClusterBlueprintRendererTest {
           super.getPropertiesMap();
 
         // return test properties, to simulate valid configuration entry
-        originalMap.put("properties", Collections.<String, Object>singletonMap("propertyOne", "valueOne"));
-        originalMap.put("properties_attributes", Collections.<String, Object>singletonMap("final", Collections.singletonMap("propertyOne", "true")));
+        originalMap.put("properties", Collections.singletonMap("propertyOne", "valueOne"));
+        originalMap.put("properties_attributes", Collections.singletonMap("final", Collections.singletonMap("propertyOne", "true")));
 
         return originalMap;
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/DefaultRendererTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/DefaultRendererTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/DefaultRendererTest.java
index a047a28..96f80b1 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/DefaultRendererTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/DefaultRendererTest.java
@@ -60,7 +60,7 @@ public class DefaultRendererTest {
 
     replay(schemaFactory, schema);
 
-    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), new HashSet<String>());
+    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), new HashSet<>());
     TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service");
 
     DefaultRenderer renderer = new DefaultRenderer();
@@ -188,7 +188,7 @@ public class DefaultRendererTest {
     HashSet<String> serviceProperties = new HashSet<>();
     QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
     TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service");
-    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component");
+    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<>()), "Component");
 
     DefaultRenderer renderer = new DefaultRenderer();
     renderer.init(schemaFactory);
@@ -273,7 +273,7 @@ public class DefaultRendererTest {
     HashSet<String> serviceProperties = new HashSet<>();
     QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
     TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service");
-    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component");
+    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<>()), "Component");
 
     DefaultRenderer renderer = new DefaultRenderer();
     renderer.init(schemaFactory);
@@ -314,7 +314,7 @@ public class DefaultRendererTest {
     serviceProperties.add("foo/bar");
     QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
     TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service");
-    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component");
+    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<>()), "Component");
 
     DefaultRenderer renderer = new DefaultRenderer();
     renderer.init(schemaFactory);

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MinimalRendererTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MinimalRendererTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MinimalRendererTest.java
index d42a261..782f148 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MinimalRendererTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MinimalRendererTest.java
@@ -63,7 +63,7 @@ public class MinimalRendererTest {
 
     replay(schemaFactory, schema);
 
-    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), new HashSet<String>());
+    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), new HashSet<>());
     TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service");
 
     MinimalRenderer renderer = new MinimalRenderer();
@@ -182,7 +182,7 @@ public class MinimalRendererTest {
     HashSet<String> serviceProperties = new HashSet<>();
     QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
     TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service");
-    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component");
+    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<>()), "Component");
 
     MinimalRenderer renderer = new MinimalRenderer();
     renderer.init(schemaFactory);
@@ -259,7 +259,7 @@ public class MinimalRendererTest {
     HashSet<String> serviceProperties = new HashSet<>();
     QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
     TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service");
-    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component");
+    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<>()), "Component");
 
     MinimalRenderer renderer = new MinimalRenderer();
     renderer.init(schemaFactory);
@@ -296,7 +296,7 @@ public class MinimalRendererTest {
     serviceProperties.add("foo/bar");
     QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
     TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service");
-    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component");
+    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<>()), "Component");
 
     MinimalRenderer renderer = new MinimalRenderer();
     renderer.init(schemaFactory);
@@ -457,7 +457,7 @@ public class MinimalRendererTest {
 
   private TreeNode<QueryInfo> createPropertyTree() {
     TreeNode<QueryInfo> propertyTree = new TreeNodeImpl<>(null, new QueryInfo(
-      new ClusterResourceDefinition(), new HashSet<String>()), "Cluster");
+      new ClusterResourceDefinition(), new HashSet<>()), "Cluster");
     Set<String> clusterProperties = propertyTree.getObject().getProperties();
     clusterProperties.add("Clusters/cluster_name");
     clusterProperties.add("Clusters/version");
@@ -469,14 +469,14 @@ public class MinimalRendererTest {
 
   private TreeNode<QueryInfo> createPropertyTreeWithSubProps() {
     TreeNode<QueryInfo> propertyTree = new TreeNodeImpl<>(null, new QueryInfo(
-      new ClusterResourceDefinition(), new HashSet<String>()), "Cluster");
+      new ClusterResourceDefinition(), new HashSet<>()), "Cluster");
     Set<String> clusterProperties = propertyTree.getObject().getProperties();
     clusterProperties.add("Clusters/cluster_name");
     clusterProperties.add("Clusters/version");
     clusterProperties.add("Clusters/prop1");
     clusterProperties.add("foo");
 
-    propertyTree.addChild(new QueryInfo(new HostResourceDefinition(), new HashSet<String>()), "Host");
+    propertyTree.addChild(new QueryInfo(new HostResourceDefinition(), new HashSet<>()), "Host");
     propertyTree.getChild("Host").getObject().getProperties().add("foo");
 
     return propertyTree;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java
index dcce44a..c3085d5 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java
@@ -180,7 +180,7 @@ public class BaseResourceDefinitionTest {
 
   private BaseResourceDefinition getResourceDefinition(Map<BaseResourceDefinition.DirectiveType, ? extends Collection<String>> directives) {
     return new BaseResourceDefinition(Resource.Type.Service,
-        Collections.<Resource.Type>emptySet(), directives) {
+        Collections.emptySet(), directives) {
       @Override
       public String getPluralName() {
         return "pluralName";

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/resources/SimpleResourceDefinitionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/SimpleResourceDefinitionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/SimpleResourceDefinitionTest.java
index 1a10658..53bd16f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/SimpleResourceDefinitionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/SimpleResourceDefinitionTest.java
@@ -56,10 +56,10 @@ public class SimpleResourceDefinitionTest {
     resourceDefinition = new SimpleResourceDefinition(Resource.Type.Stage, "stage", "stages",
         Resource.Type.Task);
 
-    validateDirectives(Collections.<String>emptySet(), resourceDefinition.getCreateDirectives());
-    validateDirectives(Collections.<String>emptySet(), resourceDefinition.getReadDirectives());
-    validateDirectives(Collections.<String>emptySet(), resourceDefinition.getUpdateDirectives());
-    validateDirectives(Collections.<String>emptySet(), resourceDefinition.getDeleteDirectives());
+    validateDirectives(Collections.emptySet(), resourceDefinition.getCreateDirectives());
+    validateDirectives(Collections.emptySet(), resourceDefinition.getReadDirectives());
+    validateDirectives(Collections.emptySet(), resourceDefinition.getUpdateDirectives());
+    validateDirectives(Collections.emptySet(), resourceDefinition.getDeleteDirectives());
 
     HashMap<BaseResourceDefinition.DirectiveType, Collection<String>> directives = new HashMap<>();
     directives.put(BaseResourceDefinition.DirectiveType.CREATE, Arrays.asList("POST1", "POST2"));

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java
index 47b6e98..deed296 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java
@@ -32,8 +32,6 @@ import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
 import org.apache.ambari.server.orm.dao.ClusterDAO;
 import org.apache.ambari.server.orm.dao.HostDAO;
-import org.apache.ambari.server.orm.entities.ClusterEntity;
-import org.apache.ambari.server.orm.entities.HostEntity;
 import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.cluster.ClusterFactory;
 import org.apache.ambari.server.state.cluster.ClustersImpl;
@@ -53,8 +51,8 @@ public class ClusterServiceTest extends BaseServiceTest {
     ClusterDAO clusterDAO = EasyMock.createNiceMock(ClusterDAO.class);
     HostDAO hostDAO = EasyMock.createNiceMock(HostDAO.class);
 
-    EasyMock.expect(clusterDAO.findAll()).andReturn(new ArrayList<ClusterEntity>()).atLeastOnce();
-    EasyMock.expect(hostDAO.findAll()).andReturn(new ArrayList<HostEntity>()).atLeastOnce();
+    EasyMock.expect(clusterDAO.findAll()).andReturn(new ArrayList<>()).atLeastOnce();
+    EasyMock.expect(hostDAO.findAll()).andReturn(new ArrayList<>()).atLeastOnce();
 
     EasyMock.replay(clusterDAO, hostDAO);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/services/DeleteResultMetaDataTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/DeleteResultMetaDataTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/DeleteResultMetaDataTest.java
index fbf14b5..1a9586d 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/DeleteResultMetaDataTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/DeleteResultMetaDataTest.java
@@ -58,7 +58,7 @@ public class DeleteResultMetaDataTest {
     metadata.addException(key1, new AuthorizationException("Exception"));
     metadata.addException(key2, new SystemException("Exception"));
     metadata.addException(key3, new HostNotFoundException("Exception"));
-    metadata.addException(key4, new UnsupportedPropertyException(Resource.Type.Action, Collections.<String>emptySet()));
+    metadata.addException(key4, new UnsupportedPropertyException(Resource.Type.Action, Collections.emptySet()));
     metadata.addException(key5, new NullPointerException());
 
     assertTrue(metadata.getDeletedKeys().isEmpty());

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/services/KerberosServiceMetaInfoTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/KerberosServiceMetaInfoTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/KerberosServiceMetaInfoTest.java
index 4137ffb..9dd4b5b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/KerberosServiceMetaInfoTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/KerberosServiceMetaInfoTest.java
@@ -191,7 +191,7 @@ public class KerberosServiceMetaInfoTest {
   public void test220Dependencies() throws Exception {
     testDependencies(new HashMap<String, Map<String, DependencyInfo>>() {
       {
-        put("KERBEROS_CLIENT", new HashMap<String, DependencyInfo>());
+        put("KERBEROS_CLIENT", new HashMap<>());
       }
     });
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/services/NamedPropertySetTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/NamedPropertySetTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/NamedPropertySetTest.java
index a572be2..7b067fa 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/NamedPropertySetTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/NamedPropertySetTest.java
@@ -54,7 +54,7 @@ public class NamedPropertySetTest {
     NamedPropertySet propertySet3 = new NamedPropertySet("bar", mapProps);
     assertFalse(propertySet.equals(propertySet3));
 
-    NamedPropertySet propertySet4 = new NamedPropertySet("foo", new HashMap<String, Object>());
+    NamedPropertySet propertySet4 = new NamedPropertySet("foo", new HashMap<>());
     assertFalse(propertySet.equals(propertySet4));
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/services/RepositoryServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/RepositoryServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/RepositoryServiceTest.java
index 14f363c..647578c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/RepositoryServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/RepositoryServiceTest.java
@@ -81,7 +81,7 @@ public class RepositoryServiceTest extends BaseServiceTest {
   private class TestRepositoryService extends RepositoryService {
 
     public TestRepositoryService() {
-      super(new HashMap<Type, String>());
+      super(new HashMap<>());
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/services/RequestBodyTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/RequestBodyTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/RequestBodyTest.java
index 43dd4b5..6ca7e2c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/RequestBodyTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/RequestBodyTest.java
@@ -51,7 +51,7 @@ public class RequestBodyTest {
   public void testAddGetPropertySets() {
     RequestBody body = new RequestBody();
     assertEquals(0, body.getNamedPropertySets().size());
-    NamedPropertySet ps = new NamedPropertySet("foo", new HashMap<String, Object>());
+    NamedPropertySet ps = new NamedPropertySet("foo", new HashMap<>());
     body.addPropertySet(ps);
     assertEquals(1, body.getNamedPropertySets().size());
     assertSame(ps, body.getNamedPropertySets().iterator().next());

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/api/services/RequestFactoryTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/RequestFactoryTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/RequestFactoryTest.java
index feacb29..65cb209 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/RequestFactoryTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/RequestFactoryTest.java
@@ -55,7 +55,7 @@ public class RequestFactoryTest {
 
     //expectations
     expect(uriInfo.getQueryParameters()).andReturn(mapQueryParams).anyTimes();
-    expect(mapQueryParams.entrySet()).andReturn(Collections.<Map.Entry<String, List<String>>>emptySet()).anyTimes();
+    expect(mapQueryParams.entrySet()).andReturn(Collections.emptySet()).anyTimes();
     expect(body.getQueryString()).andReturn(null);
 
     replay(headers, uriInfo, body, resource, mapQueryParams);
@@ -89,7 +89,7 @@ public class RequestFactoryTest {
     expect(uriInfo.getQueryParameters()).andReturn(mapQueryParams).anyTimes();
     expect(mapQueryParams.entrySet()).andReturn(mapProps.entrySet()).anyTimes();
     expect(resource.getResourceDefinition()).andReturn(resourceDefinition).anyTimes();
-    expect(resourceDefinition.getCreateDirectives()).andReturn(Collections.<String>emptySet());
+    expect(resourceDefinition.getCreateDirectives()).andReturn(Collections.emptySet());
     expect(body.getQueryString()).andReturn(null);
 
     replay(headers, uriInfo, body, resource, mapQueryParams, resourceDefinition);
@@ -239,7 +239,7 @@ public class RequestFactoryTest {
     expect(uriInfo.getQueryParameters()).andReturn(mapQueryParams).anyTimes();
     expect(mapQueryParams.entrySet()).andReturn(mapProps.entrySet()).anyTimes();
     expect(resource.getResourceDefinition()).andReturn(resourceDefinition).anyTimes();
-    expect(resourceDefinition.getDeleteDirectives()).andReturn(Collections.<String>emptySet());
+    expect(resourceDefinition.getDeleteDirectives()).andReturn(Collections.emptySet());
     expect(body.getQueryString()).andReturn(null);
     expect(body.getRequestInfoProperties()).andReturn(requestInfoMap).anyTimes();
 
@@ -269,9 +269,9 @@ public class RequestFactoryTest {
 
     //expectations
     expect(uriInfo.getQueryParameters()).andReturn(mapQueryParams).anyTimes();
-    expect(mapQueryParams.entrySet()).andReturn(Collections.<Map.Entry<String, List<String>>>emptySet()).anyTimes();
+    expect(mapQueryParams.entrySet()).andReturn(Collections.emptySet()).anyTimes();
     expect(resource.getResourceDefinition()).andReturn(resourceDefinition).anyTimes();
-    expect(resourceDefinition.getCreateDirectives()).andReturn(Collections.<String>emptySet());
+    expect(resourceDefinition.getCreateDirectives()).andReturn(Collections.emptySet());
     expect(body.getQueryString()).andReturn("foo=bar");
 
     replay(headers, uriInfo, body, resource, mapQueryParams, resourceDefinition);
@@ -305,7 +305,7 @@ public class RequestFactoryTest {
 
     //expectations
     expect(uriInfo.getQueryParameters()).andReturn(mapQueryParams).anyTimes();
-    expect(mapQueryParams.entrySet()).andReturn(Collections.<Map.Entry<String, List<String>>>emptySet()).anyTimes();
+    expect(mapQueryParams.entrySet()).andReturn(Collections.emptySet()).anyTimes();
     expect(resource.getResourceDefinition()).andReturn(resourceDefinition).anyTimes();
     expect(resourceDefinition.getCreateDirectives()).andReturn(Collections.singleton("foo"));
     expect(body.getQueryString()).andReturn("foo=bar");

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/audit/request/DefaultEventCreatorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/audit/request/DefaultEventCreatorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/audit/request/DefaultEventCreatorTest.java
index c3ebbb6..8b01752 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/audit/request/DefaultEventCreatorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/audit/request/DefaultEventCreatorTest.java
@@ -54,7 +54,6 @@ import org.apache.ambari.server.api.services.Result;
 import org.apache.ambari.server.api.services.ResultImpl;
 import org.apache.ambari.server.api.services.ResultStatus;
 import org.apache.ambari.server.audit.request.eventcreator.DefaultEventCreator;
-import org.apache.ambari.server.controller.spi.Resource;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -96,7 +95,7 @@ public class DefaultEventCreatorTest {
 
           @Override
           public Object getPrincipal() {
-            return new User("testuser", "password", Collections.<GrantedAuthority>emptyList());
+            return new User("testuser", "password", Collections.emptyList());
           }
 
           @Override
@@ -478,7 +477,7 @@ public class DefaultEventCreatorTest {
 
   @Test
   public void defaultEventCreatorTest__okWithMessage() {
-    ResourceInstance resource = new QueryImpl(new HashMap<Resource.Type, String>(), new HostComponentResourceDefinition(), null);
+    ResourceInstance resource = new QueryImpl(new HashMap<>(), new HostComponentResourceDefinition(), null);
     Request request =  requestFactory.createRequest(null, new RequestBody(), new LocalUriInfo("http://apache.org"), Request.Type.POST, resource);
     Result result = new ResultImpl(new ResultStatus(ResultStatus.STATUS.OK, "message"));
 
@@ -489,7 +488,7 @@ public class DefaultEventCreatorTest {
 
   @Test
   public void defaultEventCreatorTest__errorWithMessage() {
-    ResourceInstance resource = new QueryImpl(new HashMap<Resource.Type, String>(), new HostComponentResourceDefinition(), null);
+    ResourceInstance resource = new QueryImpl(new HashMap<>(), new HostComponentResourceDefinition(), null);
     Request request =  requestFactory.createRequest(null, new RequestBody(), new LocalUriInfo("http://apache.org"), Request.Type.POST, resource);
     Result result = new ResultImpl(new ResultStatus(ResultStatus.STATUS.BAD_REQUEST, "message"));
 
@@ -500,7 +499,7 @@ public class DefaultEventCreatorTest {
 
   @Test
   public void defaultEventCreatorTest__okWithoutMessage() {
-    ResourceInstance resource = new QueryImpl(new HashMap<Resource.Type, String>(), new HostComponentResourceDefinition(), null);
+    ResourceInstance resource = new QueryImpl(new HashMap<>(), new HostComponentResourceDefinition(), null);
     Request request =  requestFactory.createRequest(null, new RequestBody(), new LocalUriInfo("http://apache.org"), Request.Type.POST, resource);
     Result result = new ResultImpl(new ResultStatus(ResultStatus.STATUS.OK));
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/audit/request/RequestAuditLoggerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/audit/request/RequestAuditLoggerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/audit/request/RequestAuditLoggerTest.java
index 3017917..864c232 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/audit/request/RequestAuditLoggerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/audit/request/RequestAuditLoggerTest.java
@@ -34,7 +34,6 @@ import org.apache.ambari.server.api.services.ResultImpl;
 import org.apache.ambari.server.api.services.ResultStatus;
 import org.apache.ambari.server.audit.AuditLogger;
 import org.apache.ambari.server.audit.event.AuditEvent;
-import org.apache.ambari.server.controller.spi.Resource;
 import org.easymock.Capture;
 import org.easymock.EasyMock;
 import org.junit.After;
@@ -142,7 +141,7 @@ public class RequestAuditLoggerTest {
   }
 
   private Request createRequest(ResourceDefinition resourceDefinition, Request.Type requestType) {
-    ResourceInstance resource = new QueryImpl(new HashMap<Resource.Type, String>(), resourceDefinition, null);
+    ResourceInstance resource = new QueryImpl(new HashMap<>(), resourceDefinition, null);
     return requestFactory.createRequest(null, new RequestBody(), new LocalUriInfo(TEST_URI), requestType, resource);
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/AuditEventCreatorTestBase.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/AuditEventCreatorTestBase.java b/ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/AuditEventCreatorTestBase.java
index 3a5cc34..e0eef08 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/AuditEventCreatorTestBase.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/AuditEventCreatorTestBase.java
@@ -55,7 +55,7 @@ public class AuditEventCreatorTestBase {
 
           @Override
           public Object getPrincipal() {
-            return new User(userName, "password", Collections.<GrantedAuthority>emptyList());
+            return new User(userName, "password", Collections.emptyList());
           }
 
           @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/ConfigurationChangeEventCreatorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/ConfigurationChangeEventCreatorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/ConfigurationChangeEventCreatorTest.java
index b0a8200..55adcd0 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/ConfigurationChangeEventCreatorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/ConfigurationChangeEventCreatorTest.java
@@ -78,7 +78,7 @@ public class ConfigurationChangeEventCreatorTest extends AuditEventCreatorTestBa
     resourceNode.addChild(versionNode);
     resultTree.addChild(resourceNode);
 
-    Request request = AuditEventCreatorTestHelper.createRequest(Request.Type.PUT, Resource.Type.Cluster, new HashMap<String, Object>(), null);
+    Request request = AuditEventCreatorTestHelper.createRequest(Request.Type.PUT, Resource.Type.Cluster, new HashMap<>(), null);
     Result result = AuditEventCreatorTestHelper.createResult(new ResultStatus(ResultStatus.STATUS.OK), resultTree);
 
     AuditEvent event = AuditEventCreatorTestHelper.getEvent(creator, request, result);

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/bootstrap/BootStrapResourceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/bootstrap/BootStrapResourceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/bootstrap/BootStrapResourceTest.java
index 9034162..8fede94 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/bootstrap/BootStrapResourceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/bootstrap/BootStrapResourceTest.java
@@ -110,7 +110,7 @@ public class BootStrapResourceTest extends JerseyTest {
     BootStrapStatus status = new BootStrapStatus();
     status.setLog("Logging ");
     status.setStatus(BSStat.ERROR);
-    status.setHostsStatus(new ArrayList<BSHostStatus>());
+    status.setHostsStatus(new ArrayList<>());
     return status;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/checks/ConfigurationMergeCheckTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/ConfigurationMergeCheckTest.java b/ambari-server/src/test/java/org/apache/ambari/server/checks/ConfigurationMergeCheckTest.java
index df7bd1f..fd450b9 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/checks/ConfigurationMergeCheckTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/ConfigurationMergeCheckTest.java
@@ -160,7 +160,7 @@ public class ConfigurationMergeCheckTest {
         Collections.singleton(pi11)).anyTimes();
 
     expect(ami.getStackProperties(anyObject(String.class), anyObject(String.class))).andReturn(
-        Collections.<PropertyInfo>emptySet()).anyTimes();
+        Collections.emptySet()).anyTimes();
 
     replay(ami);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelperTest.java
index 868dea1..9b00e43 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelperTest.java
@@ -284,7 +284,7 @@ public class DatabaseConsistencyCheckHelperTest {
     services.put("HDFS", mockHDFSServiceInfo);
 
     Map<String, Map<String, Map<String, String>>> configAttributes = new HashMap<>();
-    configAttributes.put("core-site", new HashMap<String, Map<String, String>>());
+    configAttributes.put("core-site", new HashMap<>());
 
     expect(mockHDFSServiceInfo.getConfigTypeAttributes()).andReturn(configAttributes);
     expect(mockAmbariMetainfo.getServices("HDP", "2.2")).andReturn(services);
@@ -361,7 +361,7 @@ public class DatabaseConsistencyCheckHelperTest {
 
   @Test
   public void testSchemaName_NoAmbariSchema() throws Exception {
-    setupMocksForTestSchemaName("ambari", null, newArrayList("public"), Lists.<String>newArrayList());
+    setupMocksForTestSchemaName("ambari", null, newArrayList("public"), Lists.newArrayList());
     DatabaseConsistencyCheckHelper.checkSchemaName();
     assertTrue("Warnings were expected.", DatabaseConsistencyCheckHelper.getLastCheckResult() ==
         DatabaseConsistencyCheckResult.DB_CHECK_WARNING);
@@ -481,7 +481,7 @@ public class DatabaseConsistencyCheckHelperTest {
     services.put("HDFS", mockHDFSServiceInfo);
 
     Map<String, Map<String, Map<String, String>>> configAttributes = new HashMap<>();
-    configAttributes.put("core-site", new HashMap<String, Map<String, String>>());
+    configAttributes.put("core-site", new HashMap<>());
 
     expect(mockHDFSServiceInfo.getConfigTypeAttributes()).andReturn(configAttributes);
     expect(mockAmbariMetainfo.getServices("HDP", "2.2")).andReturn(services);

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/checks/HealthCheckTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/HealthCheckTest.java b/ambari-server/src/test/java/org/apache/ambari/server/checks/HealthCheckTest.java
index 332c4f1..6e04783 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/checks/HealthCheckTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/HealthCheckTest.java
@@ -77,7 +77,7 @@ public class HealthCheckTest {
 
   @Test
   public void testWarningWhenNoAlertsExist() throws AmbariException {
-    when(alertsDAO.findCurrentByCluster(eq(CLUSTER_ID))).thenReturn(Collections.<AlertCurrentEntity>emptyList());
+    when(alertsDAO.findCurrentByCluster(eq(CLUSTER_ID))).thenReturn(Collections.emptyList());
 
     PrerequisiteCheck check = new PrerequisiteCheck(null, CLUSTER_NAME);
     healthCheck.perform(check, new PrereqCheckRequest(CLUSTER_NAME));

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java b/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java
index 0cc3e73..8fcb1b2 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java
@@ -27,7 +27,6 @@ import org.apache.ambari.server.orm.dao.RepositoryVersionDAO;
 import org.apache.ambari.server.orm.entities.RepositoryVersionEntity;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
-import org.apache.ambari.server.state.Host;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.repository.ClusterVersionSummary;
@@ -35,7 +34,6 @@ import org.apache.ambari.server.state.repository.VersionDefinitionXml;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
 import org.apache.ambari.server.state.stack.UpgradePack;
-import org.apache.ambari.server.state.stack.UpgradePack.ProcessingComponent;
 import org.apache.ambari.server.state.stack.upgrade.RepositoryVersionHelper;
 import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import org.junit.Assert;
@@ -145,7 +143,7 @@ public class HostsMasterMaintenanceCheckTest {
     Assert.assertEquals(PrereqCheckStatus.FAIL, check.getStatus());
 
     Mockito.when(repositoryVersionHelper.getUpgradePackageName(Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), (UpgradeType) Mockito.anyObject())).thenReturn(upgradePackName);
-    Mockito.when(ambariMetaInfo.getUpgradePacks(Mockito.anyString(), Mockito.anyString())).thenReturn(new HashMap<String, UpgradePack>());
+    Mockito.when(ambariMetaInfo.getUpgradePacks(Mockito.anyString(), Mockito.anyString())).thenReturn(new HashMap<>());
 
     check = new PrerequisiteCheck(null, null);
     checkRequest = new PrereqCheckRequest("cluster");
@@ -160,9 +158,9 @@ public class HostsMasterMaintenanceCheckTest {
     Mockito.when(upgradePack.getName()).thenReturn(upgradePackName);
     upgradePacks.put(upgradePack.getName(), upgradePack);
     Mockito.when(ambariMetaInfo.getUpgradePacks(Mockito.anyString(), Mockito.anyString())).thenReturn(upgradePacks);
-    Mockito.when(upgradePack.getTasks()).thenReturn(new HashMap<String, Map<String,ProcessingComponent>>());
-    Mockito.when(cluster.getServices()).thenReturn(new HashMap<String, Service>());
-    Mockito.when(clusters.getHostsForCluster(Mockito.anyString())).thenReturn(new HashMap<String, Host>());
+    Mockito.when(upgradePack.getTasks()).thenReturn(new HashMap<>());
+    Mockito.when(cluster.getServices()).thenReturn(new HashMap<>());
+    Mockito.when(clusters.getHostsForCluster(Mockito.anyString())).thenReturn(new HashMap<>());
 
     check = new PrerequisiteCheck(null, null);
     checkRequest = new PrereqCheckRequest("cluster");

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/checks/SecondaryNamenodeDeletedCheckTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/SecondaryNamenodeDeletedCheckTest.java b/ambari-server/src/test/java/org/apache/ambari/server/checks/SecondaryNamenodeDeletedCheckTest.java
index 5d0ca5f..67c458a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/checks/SecondaryNamenodeDeletedCheckTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/SecondaryNamenodeDeletedCheckTest.java
@@ -30,7 +30,6 @@ import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.ServiceComponent;
-import org.apache.ambari.server.state.ServiceComponentHost;
 import org.apache.ambari.server.state.repository.ClusterVersionSummary;
 import org.apache.ambari.server.state.repository.VersionDefinitionXml;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
@@ -132,7 +131,7 @@ public class SecondaryNamenodeDeletedCheckTest {
     final ServiceComponent serviceComponent = Mockito.mock(ServiceComponent.class);
     Mockito.when(cluster.getService("HDFS")).thenReturn(service);
     Mockito.when(service.getServiceComponent("SECONDARY_NAMENODE")).thenReturn(serviceComponent);
-    Mockito.when(serviceComponent.getServiceComponentHosts()).thenReturn(Collections.<String, ServiceComponentHost>singletonMap("host", null));
+    Mockito.when(serviceComponent.getServiceComponentHosts()).thenReturn(Collections.singletonMap("host", null));
 
     PrerequisiteCheck check = new PrerequisiteCheck(null, null);
     secondaryNamenodeDeletedCheck.perform(check, new PrereqCheckRequest("cluster"));
@@ -140,7 +139,7 @@ public class SecondaryNamenodeDeletedCheckTest {
     Assert.assertEquals("HDFS", check.getFailedOn().toArray(new String[1])[0]);
     Assert.assertEquals("The SNameNode component must be deleted from host: host.", check.getFailReason());
 
-    Mockito.when(serviceComponent.getServiceComponentHosts()).thenReturn(Collections.<String, ServiceComponentHost> emptyMap());
+    Mockito.when(serviceComponent.getServiceComponentHosts()).thenReturn(Collections.emptyMap());
     check = new PrerequisiteCheck(null, null);
     secondaryNamenodeDeletedCheck.perform(check, new PrereqCheckRequest("cluster"));
     Assert.assertEquals(PrereqCheckStatus.PASS, check.getStatus());

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
index 75970cc..55eeb4e 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
@@ -192,7 +192,7 @@ public class ServiceCheckValidityCheckTest {
     serviceConfigEntity.setCreateTimestamp(CONFIG_CREATE_TIMESTAMP);
 
     when(serviceConfigDAO.getLastServiceConfig(eq(CLUSTER_ID), eq(SERVICE_NAME))).thenReturn(serviceConfigEntity);
-    when(hostRoleCommandDAO.findAll(any(Request.class), any(Predicate.class))).thenReturn(Collections.<HostRoleCommandEntity>emptyList());
+    when(hostRoleCommandDAO.findAll(any(Request.class), any(Predicate.class))).thenReturn(Collections.emptyList());
 
     PrerequisiteCheck check = new PrerequisiteCheck(null, CLUSTER_NAME);
     serviceCheckValidityCheck.perform(check, new PrereqCheckRequest(CLUSTER_NAME));

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/collections/PredicateUtilsTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/collections/PredicateUtilsTest.java b/ambari-server/src/test/java/org/apache/ambari/server/collections/PredicateUtilsTest.java
index bbd24b9..b3da55b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/collections/PredicateUtilsTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/collections/PredicateUtilsTest.java
@@ -75,7 +75,7 @@ public class PredicateUtilsTest {
 
   private Map<String, Object> createMap() {
     Map<String, Object> andMap =
-        Collections.<String, Object>singletonMap(
+        Collections.singletonMap(
             AndPredicate.NAME, Arrays.asList(
                 Collections.<String, Object>singletonMap(ContainsPredicate.NAME, Arrays.asList("services", "HDFS")),
                 Collections.<String, Object>singletonMap(EqualsPredicate.NAME, Arrays.asList("configurations/service-env/property1", "true"))
@@ -83,14 +83,14 @@ public class PredicateUtilsTest {
         );
 
     Map<String, Object> orMap =
-        Collections.<String, Object>singletonMap(OrPredicate.NAME,
+        Collections.singletonMap(OrPredicate.NAME,
             Arrays.asList(
                 Collections.<String, Object>singletonMap(EqualsPredicate.NAME, Arrays.asList("configurations/cluster-env/property1", "false")),
                 andMap
             )
         );
 
-    return Collections.<String, Object>singletonMap(NotPredicate.NAME, orMap);
+    return Collections.singletonMap(NotPredicate.NAME, orMap);
   }
 
   private String createJSON() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/AndPredicateTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/AndPredicateTest.java b/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/AndPredicateTest.java
index 1611ef5..1d83add 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/AndPredicateTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/AndPredicateTest.java
@@ -65,10 +65,10 @@ public class AndPredicateTest extends EasyMockSupport {
   @Test
   public void testToMap() {
     Predicate mockPredicate1 = createStrictMock(Predicate.class);
-    expect(mockPredicate1.toMap()).andReturn(Collections.<String, Object>singletonMap("nop", "foo")).times(1);
+    expect(mockPredicate1.toMap()).andReturn(Collections.singletonMap("nop", "foo")).times(1);
 
     Predicate mockPredicate2 = createStrictMock(Predicate.class);
-    expect(mockPredicate2.toMap()).andReturn(Collections.<String, Object>singletonMap("nop", "baz")).times(1);
+    expect(mockPredicate2.toMap()).andReturn(Collections.singletonMap("nop", "baz")).times(1);
 
     replayAll();
 
@@ -89,10 +89,10 @@ public class AndPredicateTest extends EasyMockSupport {
   @Test
   public void testToJSON() {
     Predicate mockPredicate1 = createStrictMock(Predicate.class);
-    expect(mockPredicate1.toMap()).andReturn(Collections.<String, Object>singletonMap("nop", "foo")).times(1);
+    expect(mockPredicate1.toMap()).andReturn(Collections.singletonMap("nop", "foo")).times(1);
 
     Predicate mockPredicate2 = createStrictMock(Predicate.class);
-    expect(mockPredicate2.toMap()).andReturn(Collections.<String, Object>singletonMap("nop", "baz")).times(1);
+    expect(mockPredicate2.toMap()).andReturn(Collections.singletonMap("nop", "baz")).times(1);
 
     replayAll();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/NotPredicateTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/NotPredicateTest.java b/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/NotPredicateTest.java
index 5c30f31..058f10f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/NotPredicateTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/NotPredicateTest.java
@@ -55,7 +55,7 @@ public class NotPredicateTest extends EasyMockSupport {
   @Test
   public void testToMap() {
     Predicate mockPredicate = createStrictMock(Predicate.class);
-    expect(mockPredicate.toMap()).andReturn(Collections.<String, Object>singletonMap("nop", "foo")).times(1);
+    expect(mockPredicate.toMap()).andReturn(Collections.singletonMap("nop", "foo")).times(1);
 
     replayAll();
 
@@ -73,7 +73,7 @@ public class NotPredicateTest extends EasyMockSupport {
   @Test
   public void testToJSON() {
     Predicate mockPredicate = createStrictMock(Predicate.class);
-    expect(mockPredicate.toMap()).andReturn(Collections.<String, Object>singletonMap("nop", "foo")).times(1);
+    expect(mockPredicate.toMap()).andReturn(Collections.singletonMap("nop", "foo")).times(1);
 
     replayAll();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/OrPredicateTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/OrPredicateTest.java b/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/OrPredicateTest.java
index c094d44..846b9b6 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/OrPredicateTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/collections/functors/OrPredicateTest.java
@@ -64,10 +64,10 @@ public class OrPredicateTest extends EasyMockSupport {
   @Test
   public void testToMap() {
     Predicate mockPredicate1 = createStrictMock(Predicate.class);
-    expect(mockPredicate1.toMap()).andReturn(Collections.<String, Object>singletonMap("nop", "foo")).times(1);
+    expect(mockPredicate1.toMap()).andReturn(Collections.singletonMap("nop", "foo")).times(1);
 
     Predicate mockPredicate2 = createStrictMock(Predicate.class);
-    expect(mockPredicate2.toMap()).andReturn(Collections.<String, Object>singletonMap("nop", "baz")).times(1);
+    expect(mockPredicate2.toMap()).andReturn(Collections.singletonMap("nop", "baz")).times(1);
 
     replayAll();
 
@@ -88,10 +88,10 @@ public class OrPredicateTest extends EasyMockSupport {
   @Test
   public void testToJSON() {
     Predicate mockPredicate1 = createStrictMock(Predicate.class);
-    expect(mockPredicate1.toMap()).andReturn(Collections.<String, Object>singletonMap("nop", "foo")).times(1);
+    expect(mockPredicate1.toMap()).andReturn(Collections.singletonMap("nop", "foo")).times(1);
 
     Predicate mockPredicate2 = createStrictMock(Predicate.class);
-    expect(mockPredicate2.toMap()).andReturn(Collections.<String, Object>singletonMap("nop", "baz")).times(1);
+    expect(mockPredicate2.toMap()).andReturn(Collections.singletonMap("nop", "baz")).times(1);
 
     replayAll();
 


Mime
View raw message