title: what is the purpose of BitSet valueOf in fromString method
body: <p>I would appreciate an explanation of what this line does exactly.</p>
  
  <pre><code>BitSet.valueOf(new long[] { Long.parseLong(s, 2) });
  </code></pre>
  
  <p>While this code example posted by <a href="https://stackoverflow.com/a/9334117/4177087">FauxFaus</a> really helped me understand BitSet usage, I don't find the purpose of the above line or why.
  here is the full example:</p>
  
  <pre><code>package com.tutorialspoint;
  import java.util.*;
  import java.util.BitSet;
  public class TimeZoneDemo {
  public static void main(String[] args) {
      BitSet bits1 = fromString("1000001");
      BitSet bits2 = fromString("1111111");
      System.out.println(toString(bits1)); // prints 1000001
      System.out.println(toString(bits2)); // prints 1111111
  
      bits2.and(bits1);
  
      System.out.println(toString(bits2)); // prints 1000001
  }
  
  private static BitSet fromString(final String s) {
      System.out.println(BitSet.valueOf(new long[] { Long.parseLong(s, 2) }));
      return BitSet.valueOf(new long[] { Long.parseLong(s, 2) });
  }
  private static String toString(BitSet bs) {
      return Long.toString(bs.toLongArray()[0], 2);
  }
  }
  </code></pre>
  
  <p>Please note that I can't comment on the original answer to ask the OP.</p>