title: SnakeYAML loads Objects that cannot be used conventionally
body: <p>So I am loading a YAML file using this code.</p>
  
  <pre><code>String file = "A: true\nB: 5"
  Yaml yaml = new Yaml();
  Map settings = (Map) yaml.load(file);
  
  System.out.println(settings.get("A"));
  </code></pre>
  
  <p>The last line prints this:</p>
  
  <pre><code>class    java.lang.Boolean
  </code></pre>
  
  <p>which is expected.  However, when I try to actually use the Boolean, for example with a basic if-statement:</p>
  
  <pre><code>if (settings.get("A")) {
      System.out.println("We want to do A!");
  }
  </code></pre>
  
  <p>this statement throws an error:</p>
  
  <pre><code>java: incompatible types
      required: boolean
      found:    java.lang.Object
  </code></pre>
  
  <p>telling me that the if-statement was expecting a boolean but received a java.lang.Object instead. This has me confused.  Why, when I get the objects class, does it return the type that I want, but that object cannot be used in the context of said type?</p>
  
  <p>At first, I naively thought it might be the fact that SnakeYAML was returning a subclass of Object type rather than a primitive type.  After some tests and a small amount of thought, I realized that was no the cause of my issue.</p>
  
  <p>I realized that I can fix this error by simply casting each value as its respective type, but my YAML file contains a lot of different values which I don't want to manually cast each time I reference them... that somewhat defeats my purpose for using YAML in the first place.</p>
  
  <p>Anyway, insight into why I can't use an object that thinks its a Boolean <strong>as a boolean</strong> would be greatly appreciated. </p>