#vulnerable code 
                              @Test
  public void testView() throws IOException {
    UserDefinedFileAttributeView view =
        service.getFileAttributeView(fileSupplier(), UserDefinedFileAttributeView.class);
    assertNotNull(view);

    ASSERT.that(view.name()).is("user");
    ASSERT.that(view.list()).isEmpty();

    byte[] b1 = {0, 1, 2};
    byte[] b2 = {0, 1, 2, 3, 4};

    view.write("b1", ByteBuffer.wrap(b1));
    view.write("b2", ByteBuffer.wrap(b2));

    ASSERT.that(view.list()).has().allOf("b1", "b2");
    ASSERT.that(service.readAttributes(file, "user:*").keySet())
        .has().allOf("b1", "b2");

    ASSERT.that(view.size("b1")).is(3);
    ASSERT.that(view.size("b2")).is(5);

    ByteBuffer buf1 = ByteBuffer.allocate(view.size("b1"));
    ByteBuffer buf2 = ByteBuffer.allocate(view.size("b2"));

    view.read("b1", buf1);
    view.read("b2", buf2);

    ASSERT.that(Arrays.equals(b1, buf1.array())).isTrue();
    ASSERT.that(Arrays.equals(b2, buf2.array())).isTrue();

    view.delete("b2");

    ASSERT.that(view.list()).has().exactly("b1");
    ASSERT.that(service.readAttributes(file, "user:*").keySet())
        .has().exactly("b1");

    try {
      view.size("b2");
      fail();
    } catch (IllegalArgumentException expected) {
      ASSERT.that(expected.getMessage()).contains("not set");
    }

    try {
      view.read("b2", ByteBuffer.allocate(10));
      fail();
    } catch (IllegalArgumentException expected) {
      ASSERT.that(expected.getMessage()).contains("not set");
    }

    view.write("b1", ByteBuffer.wrap(b2));
    ASSERT.that(view.size("b1")).is(5);

    view.delete("b2"); // succeeds
  } 
                            #location 7 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                              @Test
  public void testView() throws IOException {
    UserDefinedFileAttributeView view = provider.getView(attributeStoreSupplier());
    assertNotNull(view);

    ASSERT.that(view.name()).is("user");
    ASSERT.that(view.list()).isEmpty();

    byte[] b1 = {0, 1, 2};
    byte[] b2 = {0, 1, 2, 3, 4};

    view.write("b1", ByteBuffer.wrap(b1));
    view.write("b2", ByteBuffer.wrap(b2));

    ASSERT.that(view.list()).has().allOf("b1", "b2");
    ASSERT.that(store.getAttributeKeys()).has().exactly("user:b1", "user:b2");

    ASSERT.that(view.size("b1")).is(3);
    ASSERT.that(view.size("b2")).is(5);

    ByteBuffer buf1 = ByteBuffer.allocate(view.size("b1"));
    ByteBuffer buf2 = ByteBuffer.allocate(view.size("b2"));

    view.read("b1", buf1);
    view.read("b2", buf2);

    ASSERT.that(Arrays.equals(b1, buf1.array())).isTrue();
    ASSERT.that(Arrays.equals(b2, buf2.array())).isTrue();

    view.delete("b2");

    ASSERT.that(view.list()).has().exactly("b1");
    ASSERT.that(store.getAttributeKeys()).has().exactly("user:b1");

    try {
      view.size("b2");
      fail();
    } catch (IllegalArgumentException expected) {
      ASSERT.that(expected.getMessage()).contains("not set");
    }

    try {
      view.read("b2", ByteBuffer.allocate(10));
      fail();
    } catch (IllegalArgumentException expected) {
      ASSERT.that(expected.getMessage()).contains("not set");
    }

    view.write("b1", ByteBuffer.wrap(b2));
    ASSERT.that(view.size("b1")).is(5);

    view.delete("b2"); // succeeds
  }