Java Programming

Java Programming
Write a recursive function that will test to see if the input String parameter belongs to the following format:

L={S:S is in the form of AnB3n, for some n >= 0} where n and 3n are powers.

Example:AABBBBBB contains ABBB

This class should have two methods:

public static boolean IsIn(String w){ //body}

public static void main(String[] args){ //test function