@Test
public void testGetHMSNodes()
    throws HMSRestException
{

    ServerNodeConnector.getInstance().setNodeMap( new ConcurrentHashMap<String, HmsNode>() );
    ComponentEventRestServiceTest.insertNodeInNodeMap( ComponentEventRestServiceTest.getServerNode() );
    SwitchNode switchNode = new SwitchNode( "Arista", "SSH", "10.28.197.248", 22, "lanier", "l@ni3r2o14" );
    ConcurrentHashMap<String, SwitchNode> switchMap = new ConcurrentHashMap<String, SwitchNode>();
    switchMap.put( "S1", switchNode );
    SwitchNodeConnector.getInstance().switchNodeMap = switchMap;
    HMSManagementRestService service = new HMSManagementRestService();
    Map<String, Object[]> hmsNodes = service.getHMSNodes();
    // Test for masked objects;
    Object[] serverNodes = hmsNodes.get( Constants.HOSTS );
    for ( Object serverNode : serverNodes )
    {
        ServerNode servNode = (ServerNode) serverNode;
        assertEquals( servNode.getNodeID(), "N1" );
        assertEquals( servNode.getBoardProductName(), "S2600GZ" );
        assertEquals( servNode.getBoardVendor(), "Intel" );
        assertEquals( servNode.getIbIpAddress(), "10.28.197.28" );
        assertEquals( servNode.getManagementIp(), "10.28.197.208" );
        assertEquals( servNode.getOsUserName(), "testuser" );
        assertEquals( servNode.getOsPassword(), "****" );
    }
    Object[] switches = hmsNodes.get( Constants.SWITCHES );
    for ( Object obj : switches )
    {
        SwitchNode sNode = (SwitchNode) obj;
        assertEquals( sNode.getSwitchId(), "Arista" );
        assertEquals( sNode.getProtocol(), "SSH" );
        assertEquals( sNode.getPort(), new Integer( 22 ) );
        assertEquals( sNode.getUsername(), "lanier" );
        assertEquals( sNode.getPassword(), "****" );
    }
    // Test for original objects
    Map<String, HmsNode> nodeMap = ServerNodeConnector.getInstance().getNodeMap();
    ServerNode servNode = (ServerNode) nodeMap.get( "N1" );
    assertEquals( servNode.getNodeID(), "N1" );
    assertEquals( servNode.getBoardProductName(), "S2600GZ" );
    assertEquals( servNode.getBoardVendor(), "Intel" );
    assertEquals( servNode.getIbIpAddress(), "10.28.197.28" );
    assertEquals( servNode.getManagementIp(), "10.28.197.208" );
    assertEquals( servNode.getOsUserName(), "testuser" );
    assertEquals( servNode.getOsPassword(), "ospassword" );
    Map<String, SwitchNode> switchNodeMap = SwitchNodeConnector.getInstance().switchNodeMap;
    SwitchNode sNode = (SwitchNode) switchNodeMap.get( "S1" );
    assertEquals( sNode.getSwitchId(), "Arista" );
    assertEquals( sNode.getProtocol(), "SSH" );
    assertEquals( sNode.getPort(), new Integer( 22 ) );
    assertEquals( sNode.getUsername(), "lanier" );
    assertEquals( sNode.getPassword(), "l@ni3r2o14" );
}