class AndroidMocks {

    public static LayoutInflater mockLayoutInflater() {
        LayoutInflater mock = mock(LayoutInflater.class);
        when(mock.inflate(anyInt(), any(ViewGroup.class))).thenReturn(mockView());
        when(mock.inflate(anyInt(), any(ViewGroup.class), anyBoolean())).thenReturn(mockView());
        return mock;
    }

}