private TestEntry convertToTestEntry(Entry entry){
  String value=entry.getNoteOrTitle();
  if (value == null && entry.isRoot()) {
    value="R";
  }
  final TestEntry testEntry=new TestEntry(value,entry.getId());
  final ArrayList<Entry> childrenEntries=getChildrenInOrder(entry);
  final ArrayList<TestEntry> childrenTestEntries=new ArrayList<TestEntry>();
  for (  final Entry childEntry : childrenEntries) {
    childrenTestEntries.add(convertToTestEntry(childEntry));
  }
  if (!childrenTestEntries.isEmpty()) {
    testEntry.setChildren(childrenTestEntries.toArray(new TestEntry[childrenTestEntries.size()]));
  }
  return testEntry;
}

private TestEntry convertToTestEntry ( Entry entry ) { String value = entry . getNoteOrTitle ( ) ; if ( value == null && entry . isRoot ( ) ) { value = "R" ; } final TestEntry testEntry = new TestEntry ( value , entry . getId ( ) ) ; final ArrayList < Entry > childrenEntries = getChildrenInOrder ( entry ) ; final ArrayList < TestEntry > childrenTestEntries = new ArrayList < TestEntry > ( ) ; for ( final Entry childEntry : childrenEntries ) { childrenTestEntries . add ( convertToTestEntry ( childEntry ) ) ; } if ( ! childrenTestEntries . isEmpty ( ) ) { testEntry . setChildren ( childrenTestEntries . toArray ( new TestEntry [ childrenTestEntries . size ( ) ] ) ) ; } return testEntry ; }
converts a real entry to a test entry , including its children .
