code: public static List<StackTraceElement> getTraceTillPackage(String packageName) {
          StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
          // skip all elements until proxied call
          int startIndex = 0;
          for (int i = 1; i < stackTraceElements.length; i++) {
              StackTraceElement traceElement = stackTraceElements[i];
              String traceElementClassName = traceElement.getClassName();
              if (!traceElementClassName.startsWith(packageName) &&
                      !traceElementClassName.startsWith("java") &&
                      !traceElementClassName.startsWith("com.sun") &&
                      !traceElementClassName.startsWith("sun") &&
                      !"io.sniffy.Sniffy".equals(traceElementClassName) &&
                      !"io.sniffy.socket.SnifferSocketImpl".equals(traceElementClassName) &&
                      !"io.sniffy.socket.SnifferInputStream".equals(traceElementClassName) &&
                      !"io.sniffy.socket.SnifferOutputStream".equals(traceElementClassName) &&
                      !"io.sniffy.util.StackTraceExtractor".equals(traceElementClassName)
                      ) {
                  startIndex = i > 1 ? i - 1 : i;
                  break;
              }
              // go back until non java.io. trace
          }
          if (startIndex <= 0) {
              // no proxy, return entire collection
              return Arrays.asList(stackTraceElements);
          } else {
              return Arrays.asList(Arrays.copyOfRange(stackTraceElements, startIndex, stackTraceElements.length - 1));
          }
      }
docs: TODO: refactor this method