Manager { public @Nullable Node getNodeWithTag(@NonNull String tag) { synchronized (mDiscoverNode) { for (Node n : mDiscoverNode) { if (n.getTag().equals(tag)) return n; } } return null; } private  Manager(); static List<AdvertiseFilter> buildDefaultAdvertiseList(); static synchronized Manager getSharedInstance(); @RequiresPermission(allOf = { Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.BLUETOOTH, Manifest.permission.BLUETOOTH_ADMIN}) boolean startDiscovery(); @RequiresPermission(allOf = { Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.BLUETOOTH, Manifest.permission.BLUETOOTH_ADMIN}) boolean startDiscovery(int timeoutMs); @RequiresPermission(allOf = { Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.BLUETOOTH, Manifest.permission.BLUETOOTH_ADMIN}) boolean startDiscovery(int timeoutMs,List<AdvertiseFilter> filters); boolean hasConnectedNodes(); boolean isMPhy2Supported(); void addVirtualNode(); boolean addNode(final Node newNode); boolean stopDiscovery(); boolean isDiscovering(); void resetDiscovery(); void addListener(ManagerListener listener); void removeListener(ManagerListener listener); @Nullable Node getNodeWithTag(@NonNull String tag); @Nullable Node getNodeWithName(String name); List<Node> getNodes(); static void addFeatureToNode(byte deviceId,SparseArray<Class<? extends Feature>> features); static @NonNull SparseArray<Class<? extends Feature>> getNodeFeatures(byte deviceId);  }
@Test public void TestNonExistingTag() { final String nodeTag = "TestNode"; Assert.assertEquals(null, mManager.getNodeWithTag(nodeTag)); }