protected boolean writeClassFileCheck(IFile file, String fileName, byte[] newBytes)
     throws CoreException {
   try {
     byte[] oldBytes = Util.getResourceContentsAsByteArray(file);
     notEqual:
     if (newBytes.length == oldBytes.length) {
       for (int i = newBytes.length; --i >= 0; ) if (newBytes[i] != oldBytes[i]) break notEqual;
       return false; // bytes are identical so skip them
     }
     URI location = file.getLocationURI();
     if (location == null) return false; // unable to determine location of this class file
     String filePath = location.getSchemeSpecificPart();
     ClassFileReader reader = new ClassFileReader(oldBytes, filePath.toCharArray());
     // ignore local types since they're only visible inside a single method
     if (!(reader.isLocal() || reader.isAnonymous()) && reader.hasStructuralChanges(newBytes)) {
       if (JavaBuilder.DEBUG)
         System.out.println("Type has structural changes " + fileName); // $NON-NLS-1$
       addDependentsOf(new Path(fileName), true);
       this.newState.wasStructurallyChanged(fileName);
     }
   } catch (ClassFormatException e) {
     addDependentsOf(new Path(fileName), true);
     this.newState.wasStructurallyChanged(fileName);
   }
   return true;
 }
  @BeforeClass
  public static void findDependencies() throws Exception {
    Path path = Paths.get("target/classes");
    Archive archive = new Archive(path, ClassFileReader.newInstance(path)) {};
    Finder finder = Dependencies.getClassDependencyFinder();

    archive
        .reader()
        .getClassFiles()
        .forEach(
            classFile ->
                StreamSupport.stream(finder.findDependencies(classFile).spliterator(), false)
                    .filter(dependency -> !isAnnotation(dependency))
                    .filter(dependency -> !self(dependency))
                    .forEach(
                        dependency ->
                            packageDependencies
                                .computeIfAbsent(
                                    dependency.getOrigin().getPackageName(), key -> new TreeSet<>())
                                .add(dependency.getTarget().getPackageName())));
  }