title: onBindViewHolder(RecyclerView.ViewHolder holder, int position) - can't access holder's 'fun' - Kotlin to Java
body: <p>I have 2 classes for RecyclerView - Adapter and ViewHolder.
  In Adapter class which is written in Kotlin I'm implementing <code>onBindViewHolder(RecyclerView.ViewHolder holder, int position)</code> method and I am able to access <code>holder.bind()</code> -  <code>fun</code> - easly but when I try to remake this Kotlin file to Java file and access <code>holder.bind()</code> it is not possible. How can I access <code>holder.bind()</code> from Java file?</p>
  
  <pre><code>class RepoViewHolder(view: View) : RecyclerView.ViewHolder(view) {
  private val name: TextView = view.findViewById(R.id.repo_name)
  private val description: TextView = view.findViewById(R.id.repo_description)
  private val stars: TextView = view.findViewById(R.id.repo_stars)
  private val language: TextView = view.findViewById(R.id.repo_language)
  private val forks: TextView = view.findViewById(R.id.repo_forks)
  
  private var repo: Repo? = null
  
  init {
      view.setOnClickListener {
          repo?.url?.let { url -&gt;
              val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
              view.context.startActivity(intent)
          }
      }
  }
  
  fun bind(repo: Repo?) {
      if (repo == null) {
          val resources = itemView.resources
          name.text = resources.getString(R.string.loading)
          description.visibility = View.GONE
          language.visibility = View.GONE
          stars.text = resources.getString(R.string.unknown)
          forks.text = resources.getString(R.string.unknown)
      } else {
          showRepoData(repo)
      }
  }
  
  private fun showRepoData(repo: Repo) {
      this.repo = repo
      name.text = repo.fullName
  
      // if the description is missing, hide the TextView
      var descriptionVisibility = View.GONE
      if (repo.description != null) {
          description.text = repo.description
          descriptionVisibility = View.VISIBLE
      }
      description.visibility = descriptionVisibility
  
      stars.text = repo.stars.toString()
      forks.text = repo.forks.toString()
  
      // if the language is missing, hide the label and the value
      var languageVisibility = View.GONE
      if (!repo.language.isNullOrEmpty()) {
          val resources = this.itemView.context.resources
          language.text = resources.getString(R.string.language, repo.language)
          languageVisibility = View.VISIBLE
      }
      language.visibility = languageVisibility
  }
  
  companion object {
      fun create(parent: ViewGroup): RepoViewHolder {
          val view = LayoutInflater.from(parent.context)
                  .inflate(R.layout.repo_view_item, parent, false)
          return RepoViewHolder(view)
      }
  }}
  </code></pre>
  
  <p><strong>Kotlin Adapter file:</strong></p>
  
  <pre><code>class ReposAdapter : ListAdapter&lt;Repo, RecyclerView.ViewHolder&gt;(REPO_COMPARATOR) {
  
  override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
      return RepoViewHolder.create(parent)
  }
  
  override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
      val repoItem = getItem(position)
      if (repoItem != null) {
          (holder as RepoViewHolder).bind(repoItem)
      }
  }
  
  companion object {
      private val REPO_COMPARATOR = object : DiffUtil.ItemCallback&lt;Repo&gt;() {
          override fun areItemsTheSame(oldItem: Repo, newItem: Repo): Boolean =
                  oldItem.fullName == newItem.fullName
  
          override fun areContentsTheSame(oldItem: Repo, newItem: Repo): Boolean =
                  oldItem == newItem
      }
  }}
  </code></pre>
  
  <p><strong>And this is my Java file in which I'm trying to convert Kotlin's Adapter to Java:</strong></p>
  
  <pre><code>public class ReposAdapterJava extends ListAdapter&lt;Repo, RecyclerView.ViewHolder&gt; {
  
  private static DiffUtil.ItemCallback&lt;Repo&gt; callback = new DiffUtil.ItemCallback&lt;Repo&gt;() {
      @Override
      public boolean areItemsTheSame(Repo oldItem, Repo newItem) {
          return oldItem.getFullName().equals(newItem.getFullName());
      }
  
      @Override
      public boolean areContentsTheSame(Repo oldItem, Repo newItem) {
          return oldItem == newItem;
      }
  };
  
  protected ReposAdapterJava() {
      super(callback);
  }
  
  @NonNull
  @Override
  public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
      return RepoViewHolder.Companion.create(parent);
  }
  
  @Override
  public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
      Repo itemRepo = getItem(position);
      if(itemRepo != null){
          holder.bind(itemRepo) // not possible
      }
  }}
  </code></pre>
  
  <p>These code snippets are from Android Paging codelab.</p>