Throwable ex = new Throwable(); StackTraceElement[] stackElements = ex.getStackTrace(); if (stackElements != null) { for (int i = 0; i < stackElements.length; i++) { if (stackElements[i].getClassName().contains("com.xxxx")) { List<FakeSubscriptionInfo> list = new ArrayList<FakeSubscriptionInfo>(); list.add(new FakeSubscriptionInfo()); param.setResult(list); break; } } }