private static ValidationResult checkCompilerLibrary(LibraryDescriptor descriptor) {
    if (descriptor == null || descriptor.data().isEmpty()) return ValidationResult.OK;

    String libraryName = "Compiler library";

    CompilerLibraryData compilerLibraryData = (CompilerLibraryData) descriptor.data().get();

    Option<String> compilerLibraryProblem = compilerLibraryData.problem();

    if (compilerLibraryProblem.isDefined())
      return new ValidationResult(libraryName + ": " + compilerLibraryProblem.get());

    return ValidationResult.OK;
  }
 private static int lastIndexOfProperItemIn(LibraryDescriptor[] descriptors) {
   int result = -1;
   for (LibraryDescriptor descriptor : descriptors) {
     if (descriptor.data().get().problem().isDefined()) break;
     result++;
   }
   return result;
 }