void buildPackagePrefix(final String className) {
        // TODO test
        final int lastPackageSeparator = className.lastIndexOf('/');
        final String packageName = className.substring(0, lastPackageSeparator == -1 ? className.length() : lastPackageSeparator);
        final String[] splitPackage = packageName.split("/");

        if (splitPackage.length >= PROJECT_PACKAGE_HIERARCHIES) {
            projectPackagePrefix = IntStream.range(0, PROJECT_PACKAGE_HIERARCHIES).mapToObj(i -> splitPackage[i]).collect(Collectors.joining("/"));
        } else {
            projectPackagePrefix = packageName;
        }
    }
void buildPackagePrefix ( final String className ) { final int lastPackageSeparator = className . lastIndexOf ( '/' ) ; final String packageName = className . substring ( 0 , lastPackageSeparator == - 1 ? className . length ( ) : lastPackageSeparator ) ; final String [ ] splitPackage = packageName . split ( "/" ) ; if ( splitPackage . length >= PROJECT_PACKAGE_HIERARCHIES ) { projectPackagePrefix = IntStream . range ( 0 , PROJECT_PACKAGE_HIERARCHIES ) . mapToObj ( i -> splitPackage [ i ] ) . collect ( Collectors . joining ( "/" ) ) ; } else { projectPackagePrefix = packageName ; } }
Builds the project package prefix for the class of given method.
The current project which is analyzed is identified by the first two package nodes.