title: SNMP4J How Mock a GETBULK Request?
body: <p>I need to mock a GETBULK request with snmp4j in java. But I don't understand how to do it. More specific i don't understand how create TreeEvent for create response List and how answer to client.</p>
  
  <p>I've a snmpwalk like this</p>
  
  <pre><code>public void sendWalk(String community, String ipAddress, int port, String oidValue, int retries, long timeoutMillis) throws IOException {
  
      CommunityTarget comtarget = new CommunityTarget();
      comtarget.setCommunity(new OctetString(community));
      comtarget.setAddress(new UdpAddress(ipAddress + "/" + port));
      comtarget.setRetries(retries);
      comtarget.setTimeout(timeoutMillis);
      comtarget.setVersion(snmpVersion);
  
  
      OID oid = new OID(oidValue);
  
      TreeUtils treeUtils = new TreeUtils(snmp, new DefaultPDUFactory());
      List&lt;TreeEvent&gt; events = treeUtils.walk(comtarget, new OID[]{oid});
      if(events == null || events.size() == 0) {
          // TODO inserire in allarm manager ???
          log.warn(" No events . Request[Oid:"+oidValue+"]");
      }else{
          parseWalkResult(events);
      }
  
  }
  </code></pre>
  
  <p>A snmpwalk on SNMP4J is a GETBULK request, then i want to implement a mock to response at treeUtils.walk method and have List of TreeEvents as answer from mockup.</p>
  
  <p>Thank you in advance.</p>