Java Collections.assertFalse Examples

Java Collections.assertFalse - 14 examples found. These are the top rated real world Java examples of java.util.Collections.assertFalse extracted from open source projects. You can rate examples to help us improve the quality of examples.
  @Test
  public void supportsPosixlyCorrectBehavior() {
    OptionParser parser = new OptionParser("i:j::k");
    String[] arguments = {
      "-ibar", "-i", "junk", "xyz", "-jixnay", "foo", "-k", "blah", "--", "bah"
    };

    OptionSet options = parser.parse(arguments);

    assertTrue(options.has("i"));
    assertTrue(options.has("j"));
    assertTrue(options.has("k"));
    assertEquals(asList("bar", "junk"), options.valuesOf("i"));
    assertEquals(singletonList("ixnay"), options.valuesOf("j"));
    assertEquals(asList("xyz", "foo", "blah", "bah"), options.nonOptionArguments());

    parser.posixlyCorrect(true);
    options = parser.parse(arguments);

    assertTrue(options.has("i"));
    assertFalse(options.has("j"));
    assertFalse(options.has("k"));
    assertEquals(asList("bar", "junk"), options.valuesOf("i"));
    assertEquals(emptyList(), options.valuesOf("j"));
    assertEquals(
        asList("xyz", "-jixnay", "foo", "-k", "blah", "--", "bah"), options.nonOptionArguments());
  }
 @Test
 public void resolvesAbbreviationToLongOption() {
   OptionSet options = parser.parse("-fo");
   assertTrue(options.has("fox"));
   assertFalse(options.has("f"));
   assertFalse(options.has("o"));
 }
 @Test
 public void resolvesToLongOptionWithSingleDashEvenWithMatchingShortOptions() {
   OptionSet options = parser.parse("-fox");
   assertTrue(options.has("fox"));
   assertFalse(options.has("f"));
   assertFalse(options.has("o"));
   assertFalse(options.has("x"));
 }
 @Test
 public void shortOptionsInDifferentOrder() {
   OptionSet options = parser.parse("-fxo");
   assertFalse(options.has("fox"));
   assertTrue(options.has("f"));
   assertFalse(options.has("o"));
   assertTrue(options.has("x"));
   assertEquals(singletonList("o"), options.valuesOf("x"));
 }
  @Test
  public void withArgumentComingAfterCluster() {
    OptionSet options = parser.parse("-fox", "bar");

    assertTrue(options.has("fox"));
    assertFalse(options.has("f"));
    assertFalse(options.has("o"));
    assertFalse(options.has("x"));
    assertEquals(singletonList("bar"), options.nonOptionArguments());
  }
 @Test
 public void shouldDetectChangedFilesByTimeStamp() throws Exception {
   detector =
       new FileChangeDetector() {
         @Override
         protected long getModificationTimestamp(File classFile) {
           return timestamp;
         }
       };
   detector.setClasspathProvider(classpath);
   assertFalse(
       "Should have found changed files on first run", detector.findChangedFiles().isEmpty());
   assertTrue("Timestamp is unchanged", detector.findChangedFiles().isEmpty());
   timestamp += 100;
   assertFalse("Timestamp changed", detector.findChangedFiles().isEmpty());
 }