VarIndexing { public VarIndexing sub(final VarIndexing indexing) { checkNotNull(indexing); return transform().sub(indexing.transform()).build(); } private  VarIndexing(final Builder builder); static VarIndexing all(final int defaultIndex); static Builder builder(final int defaultIndex); Builder transform(); VarIndexing inc(final VarDecl<?> varDecl, final int n); VarIndexing inc(final VarDecl<?> varDecl); VarIndexing add(final VarIndexing indexing); VarIndexing sub(final VarIndexing indexing); VarIndexing join(final VarIndexing indexing); int get(final VarDecl<?> varDecl); @Override String toString();  }
@Test public void testSub() { final VarIndexing indexes1 = VarIndexing.builder(1).inc(x).inc(y).inc(y).build(); final VarIndexing indexes2 = VarIndexing.builder(0).inc(x).inc(z).build(); final VarIndexing sub = indexes1.sub(indexes2); assertEquals(1, sub.get(x)); assertEquals(3, sub.get(y)); assertEquals(0, sub.get(z)); }