Java Code Examples for java.util.HashSet#iterator()

The following examples show how to use java.util.HashSet#iterator() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseCourseOfferingImport.java    From unitime with Apache License 2.0 6 votes vote down vote up
protected void deleteUnmatchedInstructionalOfferings(){
       if (existingInstructionalOfferings.size() > 0){
       	HashSet<Long> deleteOfferings = new HashSet<Long>();
       	deleteOfferings.addAll(existingInstructionalOfferings);
       	addNote("Deleted Instructional Offerings that were not in the input file:");
       	for(Iterator<Long> ioIt = deleteOfferings.iterator(); ioIt.hasNext(); ){
        		Long uniqueId = (Long) ioIt.next();
	        	InstructionalOffering unusedIo = findInstrOffrForUniqueId(uniqueId) ; 
	        	if (unusedIo != null){
		        	addNote("\tdeleted: " + unusedIo.getCourseName());
	        		deleteInstructionalOffering(unusedIo);
	        		changeCount++;
	        	}
        	}
       	flushIfNeeded(true);
       	updateChangeList(true);
       }

}
 
Example 2
Source File: OPAC.java    From openprodoc with GNU Affero General Public License v3.0 6 votes vote down vote up
private static StringBuilder CalcOps(StringBuilder Ops, String TermId, DriverGeneric LocalSess, int Level) throws PDException
{
PDThesaur T=new PDThesaur(LocalSess);
T.Load(TermId);
StringBuilder SLev=new StringBuilder(100);
for (int i = 0; i < Level-1; i++)
    SLev.append("&nbsp;&nbsp;");
SLev.append("└ ");
//String SLev=ThesTree.substring(0, Level);
if (Level==0)
    Ops.append("<option value=\"\" selected> </option>");
else
    Ops.append("<option value=\"").append(T.getPDId()).append("\">").append(SLev).append(T.getName()).append("</option>");
HashSet listDirectDescendList = T.getListDirectDescendList(TermId);
for (Iterator iterator = listDirectDescendList.iterator(); iterator.hasNext();)
    {
    CalcOps(Ops,(String)iterator.next(), LocalSess, Level+1 );    
    }
return(Ops);
}
 
Example 3
Source File: ConditionalSpecialCasing.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
private static char[] lookUpTable(String src, int index, Locale locale, boolean bLowerCasing) {
    HashSet<Entry> set = entryTable.get(new Integer(src.codePointAt(index)));
    char[] ret = null;

    if (set != null) {
        Iterator<Entry> iter = set.iterator();
        String currentLang = locale.getLanguage();
        while (iter.hasNext()) {
            Entry entry = iter.next();
            String conditionLang = entry.getLanguage();
            if (((conditionLang == null) || (conditionLang.equals(currentLang))) &&
                    isConditionMet(src, index, locale, entry.getCondition())) {
                ret = bLowerCasing ? entry.getLowerCase() : entry.getUpperCase();
                if (conditionLang != null) {
                    break;
                }
            }
        }
    }

    return ret;
}
 
Example 4
Source File: ConditionalSpecialCasing.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private static char[] lookUpTable(String src, int index, Locale locale, boolean bLowerCasing) {
    HashSet<Entry> set = entryTable.get(new Integer(src.codePointAt(index)));
    char[] ret = null;

    if (set != null) {
        Iterator<Entry> iter = set.iterator();
        String currentLang = locale.getLanguage();
        while (iter.hasNext()) {
            Entry entry = iter.next();
            String conditionLang = entry.getLanguage();
            if (((conditionLang == null) || (conditionLang.equals(currentLang))) &&
                    isConditionMet(src, index, locale, entry.getCondition())) {
                ret = bLowerCasing ? entry.getLowerCase() : entry.getUpperCase();
                if (conditionLang != null) {
                    break;
                }
            }
        }
    }

    return ret;
}
 
Example 5
Source File: LinearModel.java    From ml-ease with Apache License 2.0 6 votes vote down vote up
/**
 * Linear combination of this model with another model y. x = ax + by, where x and y are
 * both LinearModel.
 * 
 * @param a
 * @param b
 * @param y
 * @return
 */
public void linearCombine(double a, double b, LinearModel y)
{
  _intercept = a * _intercept + b * y.getIntercept();
  HashSet<String> keys = new HashSet<String>(_coefficients.keySet());
  keys.addAll(y.getCoefficients().keySet());
  Iterator<String> iter = keys.iterator();
  while (iter.hasNext())
  {
    String key = iter.next();
    double value = 0;
    if (_coefficients.containsKey(key))
    {
      value = value + a * _coefficients.get(key);
    }
    if (y.getCoefficients().containsKey(key))
    {
      value = value + b * y.getCoefficients().get(key);
    }
    _coefficients.put(key, value);
  }
}
 
Example 6
Source File: PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
public static void putOperation() {
  Region region = cache.getRegion(PartitionedRegionName);
  assertNotNull(region);
  final HashSet testKeysSet = new HashSet();
  for (int i = (totalNumBuckets.intValue() * 10); i > 0; i--) {
    testKeysSet.add("execKey-" + i);
  }
  int j = 0;
  HashSet origVals = new HashSet();
  for (Iterator i = testKeysSet.iterator(); i.hasNext();) {
    Integer val = new Integer(j++);
    origVals.add(val);
    region.put(i.next(), val);
  }
}
 
Example 7
Source File: ForeignKey.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * Compares this foreign key to the given one while ignoring the case of identifiers.
 * 
 * @param otherFk The other foreign key
 * @return <code>true</code> if this foreign key is equal (ignoring case) to the given one
 */
public boolean equalsIgnoreCase(ForeignKey otherFk)
{
    boolean checkName = (_name != null) && (_name.length() > 0) &&
                        (otherFk._name != null) && (otherFk._name.length() > 0);

    if ((!checkName || _name.equalsIgnoreCase(otherFk._name)) &&
        _foreignTableName.equalsIgnoreCase(otherFk._foreignTableName))
    {
        HashSet otherRefs = new HashSet();

        otherRefs.addAll(otherFk._references);
        for (Iterator it = _references.iterator(); it.hasNext();)
        {
            Reference curLocalRef = (Reference)it.next();
            boolean   found       = false;

            for (Iterator otherIt = otherRefs.iterator(); otherIt.hasNext();)
            {
                Reference curOtherRef = (Reference)otherIt.next();

                if (curLocalRef.equalsIgnoreCase(curOtherRef))
                {
                    otherIt.remove();
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                return false;
            }
        }
        return otherRefs.isEmpty();
    }
    else
    {
        return false;
    }
}
 
Example 8
Source File: PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
public static void putOperation() {
  Region region = cache.getRegion(PartitionedRegionName);
  assertNotNull(region);
  final HashSet testKeysSet = new HashSet();
  for (int i = (totalNumBuckets.intValue() * 10); i > 0; i--) {
    testKeysSet.add("execKey-" + i);
  }
  int j = 0;
  HashSet origVals = new HashSet();
  for (Iterator i = testKeysSet.iterator(); i.hasNext();) {
    Integer val = new Integer(j++);
    origVals.add(val);
    region.put(i.next(), val);
  }
}
 
Example 9
Source File: PRClientServerRegionFunctionExecutionDUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
public static void serverMultiKeyExecutionSocketTimeOut(Boolean isByName) {
  Region region = cache.getRegion(PartitionedRegionName);
  assertNotNull(region);
  final HashSet testKeysSet = new HashSet();
  for (int i = (totalNumBuckets.intValue() * 2); i > 0; i--) {
    testKeysSet.add("execKey-" + i);
  }
  DistributedSystem.setThreadsSocketPolicy(false);
  Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_SOCKET_TIMEOUT);
  FunctionService.registerFunction(function);
  Execution dataSet = FunctionService.onRegion(region);
  try {
    int j = 0;
    HashSet origVals = new HashSet();
    for (Iterator i = testKeysSet.iterator(); i.hasNext();) {
      Integer val = new Integer(j++);
      origVals.add(val);
      region.put(i.next(), val);
    }
    List l = null;
    ResultCollector rc1 = execute(dataSet, testKeysSet, Boolean.TRUE,
        function, isByName);
    l = ((List)rc1.getResult());
    getLogWriter().info("Result size : " + l.size());
    assertEquals(3, l.size());
    for (Iterator i = l.iterator(); i.hasNext();) {
      assertEquals(Boolean.TRUE, i.next());
    }

  }catch(Exception e){
    fail("Test failed after the put operation", e);
    
  }
}
 
Example 10
Source File: ForeignKey.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * Compares this foreign key to the given one while ignoring the case of identifiers.
 * 
 * @param otherFk The other foreign key
 * @return <code>true</code> if this foreign key is equal (ignoring case) to the given one
 */
public boolean equalsIgnoreCase(ForeignKey otherFk)
{
    boolean checkName = (_name != null) && (_name.length() > 0) &&
                        (otherFk._name != null) && (otherFk._name.length() > 0);

    if ((!checkName || _name.equalsIgnoreCase(otherFk._name)) &&
        _foreignTableName.equalsIgnoreCase(otherFk._foreignTableName))
    {
        HashSet otherRefs = new HashSet();

        otherRefs.addAll(otherFk._references);
        for (Iterator it = _references.iterator(); it.hasNext();)
        {
            Reference curLocalRef = (Reference)it.next();
            boolean   found       = false;

            for (Iterator otherIt = otherRefs.iterator(); otherIt.hasNext();)
            {
                Reference curOtherRef = (Reference)otherIt.next();

                if (curLocalRef.equalsIgnoreCase(curOtherRef))
                {
                    otherIt.remove();
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                return false;
            }
        }
        return otherRefs.isEmpty();
    }
    else
    {
        return false;
    }
}
 
Example 11
Source File: PRClientServerRegionFunctionExecutionDUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
public static void serverMultiKeyExecution_ThrowException(Boolean isByName) {
  Region region = cache.getRegion(PartitionedRegionName);
  assertNotNull(region);
  final HashSet testKeysSet = new HashSet();
  for (int i = (totalNumBuckets.intValue() * 2); i > 0; i--) {
    testKeysSet.add("execKey-" + i);
  }
  DistributedSystem.setThreadsSocketPolicy(false);
  Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_THROW_EXCEPTION);
  FunctionService.registerFunction(function);
  Execution dataSet = FunctionService.onRegion(region);
  int j = 0;
  HashSet origVals = new HashSet();
  for (Iterator i = testKeysSet.iterator(); i.hasNext();) {
    Integer val = new Integer(j++);
    origVals.add(val);
    region.put(i.next(), val);
  }
  try {
    List l = null;
    ResultCollector rc1 = execute(dataSet, testKeysSet, Boolean.TRUE,
        function, isByName);
    fail("Exception Expected");
  }
  catch(Exception ex){
    ex.printStackTrace();
  }
}
 
Example 12
Source File: ThesTree.java    From openprodoc with GNU Affero General Public License v3.0 5 votes vote down vote up
private String GenTreeThes(HttpServletRequest Req) 
{
StringBuilder ThesTree=new StringBuilder(3000);
DriverGeneric PDSession=getSessOPD(Req);
String ThesaurId=Req.getParameter("ThesId");
String ThesId=Req.getParameter("id");
try {
PDThesaur CurThes = new PDThesaur(PDSession);
if (ThesaurId!=null)
    {  
    CurThes.Load(ThesaurId);
    ThesTree.append("<tree id=\"0\" radio=\"1\"><item child=\"1\" id=\"").append(EscapeTree(CurThes.getPDId())).append("\" text=\"").append(EscapeTree(CurThes.getName())).append("\" open=\"1\">");
    }
else
    ThesTree.append("<tree id=\"").append(ThesId).append("\" open=\"1\">");
HashSet Child =CurThes.getListDirectDescendList(ThesId);
for (Iterator it = Child.iterator(); it.hasNext();)
    {
    String ChildId=(String)it.next();
     if (ChildId.compareTo(PDThesaur.ROOTTERM)==0)
        continue;
    PDThesaur ChildTerm=new PDThesaur(PDSession);
    ChildTerm.Load(ChildId);
    ThesTree.append("<item child=\"1\" id=\"").append(EscapeTree(ChildTerm.getPDId())).append("\" text=\"").append(EscapeTree(ChildTerm.getName())).append("\"></item>");
    }
} catch(Exception Ex)
    {  
    }
if (ThesaurId!=null)
    ThesTree.append("</item>");
ThesTree.append("</tree>");
return(ThesTree.toString());
}
 
Example 13
Source File: ResourceHelper.java    From tlaplus with MIT License 5 votes vote down vote up
/**
 * If node is an element of modules, it does nothing.  If it is then it
 * adds to <code>modules</code> all modules imported (directly or indirectly)
 * by module <code>node</code> by an EXTENDS statement or by an unnamed
 * INSTANCE occurring before Location <code>loc</code>.  It adds to 
 * <code>symbols</code> all symbols sym that occur in a
 * 
 *    sym == INSTANCE ...
 *    
 * statement that occurs in module <code>node</code> before location 
 * <code>loc</code> or anywhere in one of the modules added to <code>modules</code>.
 * 
 * This procedure is called by declaredSymbolsInScope and by itself, the
 * latter calls always with loc a Location beyond the end of any module.
 * 
 * @param modules
 * @param symbols
 * @param loc
 * @param node
 */
public static void addImportedModulesSet(HashSet<ModuleNode> modules, StringSet symbols, 
                               Location loc, ModuleNode node) {
    if (modules.contains(node)) {
        return ;
    }
    modules.add(node) ;
    
    HashSet<ModuleNode> extendees = node.getExtendedModuleSet();
    Iterator<ModuleNode> iter = extendees.iterator() ;
    while (iter.hasNext()) {
        ModuleNode modNode = iter.next() ;
        addImportedModulesSet(modules, symbols, infiniteLoc, modNode) ;
    }
    
    InstanceNode[] instances = node.getInstances() ;
    for (int i = 0; i < instances.length; i++) {
        // We add the instance only if its comes before loc.
        // For a LOCAL instance, we add the module to `module' or its name to `symbols'
        // only if this is the initial call, which is the case iff  loc # infiniteLoc
        if ( earlierLine(instances[i].stn.getLocation(), loc)
             && (   ! instances[i].getLocal()
                 || earlierLine(loc, infiniteLoc))){
           if (instances[i].getName() != null) {
               symbols.add(instances[i].getName().toString()) ;
           } else {
              // Testing on 9 Oct 2014 revealed that the following is unnecessary because
              // the defined operators imported into a module M without renaming by an INSTANCE
              // are contained in M.getOpDefs().  Imported named theorems are similarly
              // contained in M.getThmOrAssDefs().
              
              addImportedModulesSet(modules, symbols, infiniteLoc, instances[i].getModule()) ; 
           }
        }
    }     

}
 
Example 14
Source File: Solution.java    From JavaExercises with GNU General Public License v2.0 5 votes vote down vote up
public static HashSet<Integer> removeAllNumbersMoreThan10(HashSet<Integer> set) {
    Iterator<Integer> iterator = set.iterator();
    while (iterator.hasNext())
        if (iterator.next() > 10)
            iterator.remove();
    return set;
}
 
Example 15
Source File: StringSet.java    From tlaplus with MIT License 4 votes vote down vote up
public StringSet(HashSet<String>hSet) {
    Iterator iter = hSet.iterator() ;
    while (iter.hasNext()) {
        contents.add((String) iter.next()) ;
    }
}
 
Example 16
Source File: PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
public static void serverMultiKeyExecution_Inline() {
  Region region = cache.getRegion(PartitionedRegionName);
  assertNotNull(region);
  final HashSet testKeysSet = new HashSet();
  for (int i = (totalNumBuckets.intValue() * 2); i > 0; i--) {
    testKeysSet.add("execKey-" + i);
  }
  DistributedSystem.setThreadsSocketPolicy(false);
  Execution dataSet = FunctionService.onRegion(region);
  try {
    int j = 0;
    HashSet origVals = new HashSet();
    for (Iterator i = testKeysSet.iterator(); i.hasNext();) {
      Integer val = new Integer(j++);
      origVals.add(val);
      region.put(i.next(), val);
    }
    List l = null;
    ResultCollector rc1 = dataSet.withFilter(testKeysSet)
        .withArgs(Boolean.TRUE).execute(new FunctionAdapter() {
          public void execute(FunctionContext context) {
            if (context.getArguments() instanceof String) {
              context.getResultSender().lastResult("Success");
            }
            else if (context.getArguments() instanceof Boolean) {
              context.getResultSender().lastResult(Boolean.TRUE);
            }
          }

          public String getId() {
            return getClass().getName();
          }

          public boolean hasResult() {
            return true;
          }
        });
    l = ((List)rc1.getResult());
    getLogWriter().info("Result size : " + l.size());
    assertEquals(3, l.size());
    for (Iterator i = l.iterator(); i.hasNext();) {
      assertEquals(Boolean.TRUE, i.next());
    }
  }
  catch (Exception e) {
    getLogWriter().info("Exception : " + e.getMessage());
    e.printStackTrace();
    fail("Test failed after the put operation");

  }
}
 
Example 17
Source File: PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
public static void serverMultiKeyExecution_FunctionInvocationTargetException() {
  Region region = cache.getRegion(PartitionedRegionName);
  assertNotNull(region);
  final HashSet testKeysSet = new HashSet();
  for (int i = (totalNumBuckets.intValue() * 2); i > 0; i--) {
    testKeysSet.add("execKey-" + i);
  }
  DistributedSystem.setThreadsSocketPolicy(false);
  Execution dataSet = FunctionService.onRegion(region);
  int j = 0;
  HashSet origVals = new HashSet();
  for (Iterator i = testKeysSet.iterator(); i.hasNext();) {
    Integer val = new Integer(j++);
    origVals.add(val);
    region.put(i.next(), val);
  }
  ResultCollector rc1 = null;
  try {
    rc1 = dataSet.withFilter(testKeysSet).withArgs(Boolean.TRUE)
        .execute(new FunctionAdapter() {
          public void execute(FunctionContext context) {
            if (((RegionFunctionContext)context).isPossibleDuplicate()) {
              context.getResultSender().lastResult(new Integer(retryCount));
              return;
            }
            if (context.getArguments() instanceof Boolean) {
              throw new FunctionInvocationTargetException(
                  "I have been thrown from TestFunction");
            }
          }

          public String getId() {
            return getClass().getName();
          }

          public boolean hasResult() {
            return true;
          }
        });

    List list = (ArrayList)rc1.getResult();
    assertEquals(list.get(0), 0);
  }
  catch (Throwable e) {
    e.printStackTrace();
    fail("This is not expected Exception", e);
  }

}
 
Example 18
Source File: PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
public static void serverMultiKeyExecutionNoResult(Boolean isByName) {
  Region region = cache.getRegion(PartitionedRegionName);
  assertNotNull(region);
  final HashSet testKeysSet = new HashSet();
  for (int i = (totalNumBuckets.intValue() * 2); i > 0; i--) {
    testKeysSet.add("execKey-" + i);
  }
  DistributedSystem.setThreadsSocketPolicy(false);
  Function function = new TestFunction(false, TEST_FUNCTION7);
  FunctionService.registerFunction(function);
  Execution dataSet = FunctionService.onRegion(region);
  try {
    String msg = "<ExpectedException action=add>" + "FunctionException"
        + "</ExpectedException>";
    cache.getLogger().info(msg);
    int j = 0;
    HashSet origVals = new HashSet();
    for (Iterator i = testKeysSet.iterator(); i.hasNext();) {
      Integer val = new Integer(j++);
      origVals.add(val);
      region.put(i.next(), val);
    }
    ResultCollector rc1 = execute(dataSet, testKeysSet, Boolean.TRUE,
        function, isByName);
    rc1.getResult();
    Thread.sleep(20000);
    fail("Test failed after the put operation");
  }
  catch (FunctionException expected) {
    expected.printStackTrace();
    getLogWriter().info("Exception : " + expected.getMessage());
    assertTrue(expected.getMessage().startsWith(
        (LocalizedStrings.ExecuteFunction_CANNOT_0_RESULTS_HASRESULT_FALSE
            .toLocalizedString("return any"))));
  }
  catch (Exception notexpected) {
    fail("Test failed during execute or sleeping", notexpected);
  }
  finally {
    cache.getLogger().info(
        "<ExpectedException action=remove>" + "FunctionException"
            + "</ExpectedException>");
  }
}
 
Example 19
Source File: PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
public static void serverMultiKeyExecution_Inline() {
  Region region = cache.getRegion(PartitionedRegionName);
  assertNotNull(region);
  final HashSet testKeysSet = new HashSet();
  for (int i = (totalNumBuckets.intValue() * 2); i > 0; i--) {
    testKeysSet.add("execKey-" + i);
  }
  DistributedSystem.setThreadsSocketPolicy(false);
  Execution dataSet = FunctionService.onRegion(region);
  try {
    int j = 0;
    HashSet origVals = new HashSet();
    for (Iterator i = testKeysSet.iterator(); i.hasNext();) {
      Integer val = new Integer(j++);
      origVals.add(val);
      region.put(i.next(), val);
    }
    List l = null;
    ResultCollector rc1 = dataSet.withFilter(testKeysSet)
        .withArgs(Boolean.TRUE).execute(new FunctionAdapter() {
          public void execute(FunctionContext context) {
            if (context.getArguments() instanceof String) {
              context.getResultSender().lastResult("Success");
            }
            else if (context.getArguments() instanceof Boolean) {
              context.getResultSender().lastResult(Boolean.TRUE);
            }
          }

          public String getId() {
            return getClass().getName();
          }

          public boolean hasResult() {
            return true;
          }
        });
    l = ((List)rc1.getResult());
    getLogWriter().info("Result size : " + l.size());
    assertEquals(3, l.size());
    for (Iterator i = l.iterator(); i.hasNext();) {
      assertEquals(Boolean.TRUE, i.next());
    }
  }
  catch (Exception e) {
    getLogWriter().info("Exception : " + e.getMessage());
    e.printStackTrace();
    fail("Test failed after the put operation");

  }
}
 
Example 20
Source File: PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
public static void serverMultiKeyExecution_Inline() {
  Region region = cache.getRegion(PartitionedRegionName);
  assertNotNull(region);
  final HashSet testKeysSet = new HashSet();
  for (int i = (totalNumBuckets.intValue() * 2); i > 0; i--) {
    testKeysSet.add("execKey-" + i);
  }
  DistributedSystem.setThreadsSocketPolicy(false);
  Execution dataSet = FunctionService.onRegion(region);
  try {
    int j = 0;
    HashSet origVals = new HashSet();
    for (Iterator i = testKeysSet.iterator(); i.hasNext();) {
      Integer val = new Integer(j++);
      origVals.add(val);
      region.put(i.next(), val);
    }
    List l = null;
    ResultCollector rc1 = dataSet.withFilter(testKeysSet)
        .withArgs(Boolean.TRUE).execute(new FunctionAdapter() {
          public void execute(FunctionContext context) {
            if (context.getArguments() instanceof String) {
              context.getResultSender().lastResult("Success");
            }
            else if (context.getArguments() instanceof Boolean) {
              context.getResultSender().lastResult(Boolean.TRUE);
            }
          }

          public String getId() {
            return getClass().getName();
          }

          public boolean hasResult() {
            return true;
          }
        });
    l = ((List)rc1.getResult());
    getLogWriter().info("Result size : " + l.size());
    assertEquals(3, l.size());
    for (Iterator i = l.iterator(); i.hasNext();) {
      assertEquals(Boolean.TRUE, i.next());
    }
  }
  catch (Exception e) {
    getLogWriter().info("Exception : " + e.getMessage());
    e.printStackTrace();
    fail("Test failed after the put operation");

  }
}