Map<String,String> doc1Props = new HashMap<String,String>();doc1Props.put("filename", "doc1");
Map<String,String> doc2Props = new HashMap<String,String>();doc2Props.put("filename", "doc2");
Document[] sourceDocs = !fieldsExpected ?
new Document[]{
new FileDocument("doc1", new ByteArrayInputStream("cats dogs horses".getBytes()), new EnglishTokeniser()),
new FileDocument("doc2", new ByteArrayInputStream("chicken cats chicken chicken".getBytes()), new EnglishTokeniser())
}
: new Document[]{
new TaggedDocument(new ByteArrayInputStream("<title>cats</title> dogs horses".getBytes()), doc1Props, new EnglishTokeniser()),
new TaggedDocument(new ByteArrayInputStream("<title>chicken</title> cats chicken chicken".getBytes()), doc2Props, new EnglishTokeniser())
};
int[] doclens = new int[]{3, 4};