### Question:
ConstantPatternExpansionStrategy extends ExpansionStrategy { @Override public List<Pattern> getChildPatterns(Pattern currentPattern) { List<Pattern> result = new LinkedList<>(); for (IntArrayList cluster : currentPattern.getCover()) { result.addAll(getChildPatterns(currentPattern, cluster)); } return result; } ConstantPatternExpansionStrategy(int[][] values); static String getIdentifier(); @Override Pattern generateNullPattern(BitSet attributes); @Override List<Pattern> getChildPatterns(Pattern currentPattern);  }### Answer:
@Test public void testGetChildPatternsFromExistingPattern() { int[][] values = new int[][] { new int[] {0, 1, 2}, new int[] {0, 3, 4} }; Pattern pattern = new Pattern(createAttributeMap(new int[] {0, -1, -1})); List<IntArrayList> cover = new ArrayList<>(); cover.add(new IntArrayList(new int[] {0})); cover.add(new IntArrayList(new int[] {1})); pattern.setCover(cover); ConstantPatternExpansionStrategy out = new ConstantPatternExpansionStrategy(values); List<Pattern> children = out.getChildPatterns(pattern); Assert.assertEquals(4, children.size()); Assert.assertTrue(containsPattern(children, new Pattern(createAttributeMap(new int[] {0, 1, -1})))); Assert.assertTrue(containsPattern(children, new Pattern(createAttributeMap(new int[] {0, -1, 2})))); Assert.assertTrue(containsPattern(children, new Pattern(createAttributeMap(new int[] {0, 3, -1})))); Assert.assertTrue(containsPattern(children, new Pattern(createAttributeMap(new int[] {0, -1, 4})))); }
@Test public void testGetChildPatternsFromExistingPatternWithNoVariables() { int[][] values = new int[][] { new int[] {0, 1, 2}, new int[] {0, 1, 2} }; Pattern pattern = new Pattern(createAttributeMap(new int[] {0, 1, 2})); List<IntArrayList> cover = new ArrayList<>(); cover.add(new IntArrayList(new int[] {0})); cover.add(new IntArrayList(new int[] {1})); pattern.setCover(cover); ConstantPatternExpansionStrategy out = new ConstantPatternExpansionStrategy(values); List<Pattern> children = out.getChildPatterns(pattern); Assert.assertEquals(0, children.size()); }