### Question:
SubscribeManager { private List<Subscriber> getSubscribersFuzzy(String serviceName, String namespaceId) { return pushService.getClientsFuzzy(serviceName, namespaceId); }  List<Subscriber> getSubscribers(String serviceName, String namespaceId, boolean aggregation); static Predicate<T> distinctByKey(Function<? super T, Object> keyExtractor);  }### Answer:
@Test public void testGetSubscribersFuzzy() { String serviceName = "test"; String namespaceId = "public"; boolean aggregation = Boolean.TRUE; try { List<Subscriber> clients = new ArrayList<Subscriber>(); Subscriber subscriber = new Subscriber("127.0.0.1:8080", "test", "app", "127.0.0.1", namespaceId, "testGroupName@@test_subscriber"); clients.add(subscriber); Mockito.when(pushService.getClientsFuzzy(Mockito.anyString(), Mockito.anyString())).thenReturn(clients); List<Subscriber> list = subscribeManager.getSubscribers(serviceName, namespaceId, aggregation); Assert.assertNotNull(list); Assert.assertEquals(1, list.size()); Assert.assertEquals("testGroupName@@test_subscriber", list.get(0).getServiceName()); } catch (Exception ignored) { } }
@Test public void testGetSubscribersFuzzy() { String serviceName = "test"; String namespaceId = "public"; boolean aggregation = Boolean.TRUE; try { List<Subscriber> clients = new ArrayList<Subscriber>(); Subscriber subscriber = new Subscriber("127.0.0.1:8080", "test", "app", "127.0.0.1", namespaceId, "testGroupName@@test_subscriber"); clients.add(subscriber); Mockito.when(pushService.getClientsFuzzy(Mockito.anyString(), Mockito.anyString())).thenReturn(clients); List<Subscriber> list = subscribeManager.getSubscribers(serviceName, namespaceId, aggregation); Assert.assertNotNull(list); Assert.assertEquals(1, list.size()); Assert.assertEquals("testGroupName@@test_subscriber", list.get(0).getServiceName()); } catch (Exception e) { } }