Buggy code:
public class NCubeManager { private static final String SYS_BOOTSTRAP = "sys.bootstrap" ; private static final String CLASSPATH_CUBE = "sys.classpath" ; private static final Map < ApplicationID , Map < String , Object > > ncubeCache = new ConcurrentHashMap < > ( ) ; private static final Map < ApplicationID , Map < String , Advice > > advices = new ConcurrentHashMap < > ( ) ; private static final Map < ApplicationID , GroovyClassLoader > localClassLoaders = new ConcurrentHashMap < > ( ) ; private static NCubePersister nCubePersister ; private static final Logger LOG = LogManager . getLogger ( NCubeManager . class ) ; public static void setNCubePersister ( NCubePersister persister ) { } public static NCubePersister getPersister ( ) { } public static Set < String > getCubeNames ( ApplicationID appId ) { } public static NCube getCube ( ApplicationID appId , String name ) { } static NCube ensureLoaded ( Object value ) { } static boolean isCubeCached ( ApplicationID appId , String cubeName ) { } static URLClassLoader getUrlClassLoader ( ApplicationID appId , Map input ) { } static URLClassLoader getLocalClassloader ( ApplicationID appId ) { } static void addUrlsToClassLoader ( List < String > urls , GroovyClassLoader urlClassLoader ) { } public static void addCube ( ApplicationID appId , NCube ncube ) { } static Map < String , Object > getCacheForApp ( ApplicationID appId ) { } public static void clearCacheForBranches ( ApplicationID appId ) { } public static void clearCache ( ApplicationID appId ) { } public static void clearCache ( ) { } private static void clearGroovyClassLoaderCache ( Map < String , Object > appCache ) { } public static void addAdvice ( ApplicationID appId , String wildcard , Advice advice ) { } private static void applyAdvices ( ApplicationID appId , NCube ncube ) { } public static void validateTestData ( String testData ) { } public static boolean doesCubeExist ( ApplicationID appId , String name ) { } public static void getReferencedCubeNames ( ApplicationID appId , String name , Set < String > refs ) { } public static Object [ ] getCubeRecordsFromDatabase ( ApplicationID appId , String pattern ) { } public static Object [ ] getBranchChangesFromDatabase ( ApplicationID appId ) { } private static void cacheCubes ( ApplicationID appId , Object [ ] cubes ) { } public static Object [ ] getDeletedCubesFromDatabase ( ApplicationID appId , String pattern ) { } public static void restoreCube ( ApplicationID appId , Object [ ] cubeNames , String username ) { } public static Object [ ] getRevisionHistory ( ApplicationID appId , String cubeName ) { } public static Object [ ] getAppNames ( String tenant ) { } public static Object [ ] getAppVersions ( ApplicationID appId ) { } public static void duplicate ( ApplicationID oldAppId , ApplicationID newAppId , String oldName , String newName , String username ) { } public static boolean updateCube ( ApplicationID appId , NCube ncube , String username ) { } public static int createBranch ( ApplicationID appId ) { } public static Map commitBranch ( ApplicationID appId , Object [ ] infoDtos , String username ) { } public static int rollbackBranch ( ApplicationID appId , Object [ ] infoDtos ) { } public static Object [ ] updateBranch ( ApplicationID appId ) { } public static int releaseCubes ( ApplicationID appId , String newSnapVer ) { } public static void changeVersionValue ( ApplicationID appId , String newVersion ) { } public static boolean renameCube ( ApplicationID appId , String oldName , String newName ) { } public static boolean deleteCube ( ApplicationID appId , String cubeName , String username ) { } static boolean deleteCube ( ApplicationID appId , String cubeName , boolean allowDelete , String username ) { } public static boolean updateTestData ( ApplicationID appId , String cubeName , String testData ) { } public static String getTestData ( ApplicationID appId , String cubeName ) { } public static boolean updateNotes ( ApplicationID appId , String cubeName , String notes ) { } public static String getNotes ( ApplicationID appId , String cubeName ) { } public static void createCube ( ApplicationID appId , NCube ncube , String username ) { } <START_BUG> public static List < String > getBranches ( ApplicationID appId ) { <END_BUG> NCubeManager . validateAppId ( appId ) ; return NCubeManager . getPersister ( ) . getBranches ( appId ) ; } public static ApplicationID getApplicationID ( String tenant , String app , Map < String , Object > coord ) { } public static String resolveRelativeUrl ( ApplicationID appId , String relativeUrl ) { } public static String getResourceAsString ( String name ) throws Exception { } static NCube getNCubeFromResource ( String name ) { } public static NCube getNCubeFromResource ( ApplicationID id , String name ) { } private static Object [ ] getJsonObjectFromResource ( String name ) throws IOException { } public static List < NCube > getNCubesFromResource ( String name ) { } static NCube ncubeFromJson ( String json ) { } static void validateAppId ( ApplicationID appId ) { } static void validateCube ( NCube cube ) { } static void broadcast ( ApplicationID appId ) { } }

Fix:
public static Set < String > getBranches ( ApplicationID appId ) {