StackFrameParser { @Nullable public String getClassName() { int lastDot = getLastDot(); if (lastDot == -1) { return null; } return myLine.substring(0, lastDot); } StackFrameParser(@NotNull String line); @Nullable String getClassName(); @Nullable String getFileName(); @Nullable String getMethodName(); int getLineNumber(); int getLastColon(); int getLastDot(); int getOpenParen(); int getCloseParen(); @NotNull CodeLocation toCodeLocation();  }
@Test public void getClassName() { String line = "com.example.android.displayingbitmaps.util.ImageFetcher.downloadUrlToStream(ImageFetcher.java:27)"; assertEquals("com.example.android.displayingbitmaps.util.ImageFetcher", new StackFrameParser(line).getClassName()); }
@Test public void getClassNameIfNested() { String line = "com.example.android.displayingbitmaps.util.ImageWorker$BitmapWorkerTask.doInBackground(ImageWorker.java:312)"; assertEquals("com.example.android.displayingbitmaps.util.ImageWorker$BitmapWorkerTask", new StackFrameParser(line).getClassName()); }
@Test public void getClassNameIfAnonymous() { String line = "com.example.android.displayingbitmaps.util.AsyncTask$2.call(AsyncTask.java:313)"; assertEquals("com.example.android.displayingbitmaps.util.AsyncTask$2", new StackFrameParser(line).getClassName()); }