class RepositoryConnectController implements IConnectedRepositoryInstance {

  @SuppressWarnings( "unchecked" )
  public String getRepositories() {
    RepositoriesMeta repositoriesMeta = getRepositoriesMeta();

    String connected = null;
    if ( spoonSupplier.get() != null && spoonSupplier.get().rep != null ) {
      connected = spoonSupplier.get().rep.getName();
    }
    List<JSONObject> list = new ArrayList<>();
    if ( repositoriesMeta != null ) {
      for ( int i = 0; i < repositoriesMeta.nrRepositories(); i++ ) {
        RepositoryMeta repositoryMeta = repositoriesMeta.getRepository( i );
        JSONObject repoJson = repositoryMeta.toJSONObject();
        if ( connected != null && repositoryMeta.getName().equals( connected ) ) {
          repoJson.put( "connected", true );
        }
        list.add( repoJson );
      }
    }
    return list.toString();
  }

  public  RepositoryConnectController( PluginRegistry pluginRegistry, Supplier<Spoon> spoonSupplier );
  public  RepositoryConnectController();

}