OpenMonFactory { static String getJustClassName(String className) { String[] array = Utils.tokenize(className, "[.]"); return array[array.length - 1]; } OpenMonFactory(OpenMon defaultOpenMon); void add(String... classNames); OpenMon getInstance(String key); OpenMon getFirstInstance(); String toString(); static final String JAMON; static final String JAVA_SIMON; static final String METRICS; static final String SYSOUT; static final String NULL_IMP; static final String NEW_RELIC; static final String STATSD; static final String MICROMETER; }
@Test public void testGetLastToken() throws Exception { assertThat(OpenMonFactory.getJustClassName("com.mypackage.Jamon")).isEqualTo("Jamon"); assertThat(OpenMonFactory.getJustClassName("Jamon")).isEqualTo("Jamon"); }