Code example for Pair

0
    assertThat(lastEnabled).isEqualTo(new Pair<Integer, Boolean>(666, true));
 
    int anotherNetworkId = 777;
    wifiManager.enableNetwork(anotherNetworkId, false);
    lastEnabled = shadowWifiManager.getLastEnabledNetwork();
    assertThat(lastEnabled).isEqualTo(new Pair<Integer, Boolean>(777, false));
  } 
 
  @Test 
  public void shouldReturnSetScanResults() throws Exception { 
    List<ScanResult> scanResults = new ArrayList<ScanResult>();
    shadowWifiManager.setScanResults(scanResults);
    assertThat(wifiManager.getScanResults()).isSameAs(scanResults);
  } 
 
  @Test 
  public void shouldRecordTheLastAddedNetwork() throws Exception { 
    WifiConfiguration wifiConfiguration = new WifiConfiguration();
    wifiConfiguration.networkId = -1;
    int networkId = wifiManager.addNetwork(wifiConfiguration);
    assertThat(networkId).isEqualTo(0);