Fix android tests. Share code with iOS