private static String checkService(TestContext tc, List<Service> list, String name, ServiceOptions options) { Service s = list.stream() .filter(i -> name.equals(i.getName())) .findFirst() .orElseThrow(NoSuchElementException::new); String serviceId = s.getId(); tc.assertEquals(s.getTags(), options.getTags()); tc.assertEquals(s.getAddress(), options.getAddress()); tc.assertEquals(s.getPort(), options.getPort()); for (Map.Entry<String, String> entry : options.getMeta().entrySet()) { tc.assertEquals(s.getMeta().get(entry.getKey()), entry.getValue()); } return serviceId; }