- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {ScheduledThreadPoolExecutor s =
new ScheduledThreadPoolExecutor(corePoolSize)
ThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
String str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
- Smart code suggestions by Codota
}
private void log(Event event) { if (logger == null) return; @SuppressWarnings("StringBufferReplaceableByString") StringBuilder builder = new StringBuilder() .append(event.name) .append("-> ") .append(event.attributes.toString()) .append(", super attrs: ") .append(superAttributes.toString()) .append(", filters: ") .append(Arrays.toString(event.filters)); logger.log(builder.toString()); }
@Test public void log() throws Throwable { EventLogListener logger = mock(EventLogListener.class); tracklytics.setEventLogListener(logger); Map<String, Object> attributes = new HashMap<>(); attributes.put("key", "value"); tracklytics.trackEvent("event", attributes); verify(logger).log("event-> {key=value}, super attrs: {}, filters: null"); } }