<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kenkoooo</author_name>
  <author_url>https://blog.hatena.ne.jp/kenkoooo/</author_url>
  <blog_title>宇宙ツイッタラーXの憂鬱</blog_title>
  <blog_url>https://kenkoooo.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>Problem When you have MyClass and try to write a test by mocking MyClass as the following, you will get an NPE: MyClass: open class MyClass { fun createList(string: String): List&lt;String&gt; { return listOf(&quot;A&quot;, &quot;B&quot;, &quot;C&quot;, string) } } Mocking MyClass by Mockito: import org.junit.jupiter.api.Test import o…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkenkoooo.hatenablog.com%2Fentry%2F2021%2F12%2F06%2F125825&quot; title=&quot;Put &amp;quot;open&amp;quot; to your class and its method when you get a NullPointerException by mocking your class by Mockito. - 宇宙ツイッタラーXの憂鬱&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-12-06 12:58:25</published>
  <title>Put &quot;open&quot; to your class and its method when you get a NullPointerException by mocking your class by Mockito.</title>
  <type>rich</type>
  <url>https://kenkoooo.hatenablog.com/entry/2021/12/06/125825</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
