class GradleUtil {

  @NotNull
  public static List<Library> getModuleDependencies(@NotNull IdeVariant variant) {
    List<Library> libraries = new ArrayList<>();

    IdeAndroidArtifact mainArtifact = variant.getMainArtifact();
    IdeDependencies dependencies = mainArtifact.getLevel2Dependencies();
    libraries.addAll(dependencies.getModuleDependencies());

    for (IdeBaseArtifact testArtifact : variant.getTestArtifacts()) {
      dependencies = testArtifact.getLevel2Dependencies();
      libraries.addAll(dependencies.getModuleDependencies());
    }
    return libraries.stream().distinct().collect(Collectors.toList());
  }

  private  GradleUtil();

}